The intent of Congress was to stop persons buying guns for people who were barred from buying a gun ("prohibited person" felon, etc.) The law is that the purchaser of record must be an eligible person.
The question on the form is, are you the actual purchaser of the gun.
If you buy the gun with your money to give as a bona fide gift to a person who is not barred from owning a gun, you are the actual purchaser.
If you buy the gun on behalf of another person, that is a violation of the law whether the person is eligible or is a prohibited person.
One district court has ruled that it was not a violation of the intent of congress to buy a gun on behalf of a person who could legally buy the gun themselves, but I would not want to have to argue that point in a federal appeals courts. If it gets that far, you have lost a lot even if you win.
BTW, the ATF has ruled that the holder of a state-issued medical marijuana card is a prohibited person, so you cannot buy a gun as a gift for a medical marijuana user.