Yes,it does. Buying a gun with the intention of making an illegal sale or transfer of it to someone else is a straw purchase. Purchasing a gun and later legally selling or transferring it to someone who IS legally eligible to buy it is not. As long as you don't sell or transfer it to your friend until AFTER they have the situation straightened out and are once more legally eligible to buy it, you are not breaking any laws. Any more than you would be if you sold them some other gun once they are again eligible to purchase it.
You also can't purchase guns for the purpose of reselling them, unless you have an FFL. It sometimes gets a little gray, but generally speaking multiple sales in a short period of time and a short period between purchases and sales of a firearm are going to be construed as operating as a firearms dealer, without a license. The ATF takes a dim view of that.
----
Buying a gun as a gift is also an area that can get a little grey. It really has to be a gift, bought by you with the intention to own until you legally transfer it to someone else and *not at their request*.
But that can be problematic. For example, you and your wife, son, etc, can walk into a store, they could pick out a gun, do the paperwork and you could pay for it, but that will often raise questions / concerns from the FFL and it's not unknown for a dealer to refuse to sell on the basis that it is a straw purchase - whether it really is or not. They just don't want to risk getting stung and losing their FFL.
Of course, on the other hand, if you hand your son or daughter $500 out front and then they shop for their own firearm, that still looks like a straw purchase if the FFL sees the money change hands.
The ATF and the NRA recommend using a gift card purchased from the dealer and then given to the person, who then buys what they want and fills out the paperwork. That's fine, except you can use the same approach for a straw purchase (prohibited individual buys a gift card, gives to the buyer to buy the firearm and the buyer then gives it to them later), so the whole gift card thing is mostly window dressing.
Consequently, if I am buying a firearm as a gift for someone, I just go in alone, buy it, and then present it after the fact as a gift, with no funds changing hands - and no mention that it's being bought as a gift. It's then fully on me to ensure that it is properly a gift, and legally transferred to the person receiving the gift.
The key elements are:
1) you are buying the firearm as a gift to the other person (i.e, not for any form of compensation or reimbursement);
2) you are not doing it at their request;
3) the individual you are giving it to is not a prohibited individual; and
4) you legally transfer it to the other person as a gift after you purchase it and become the legal owner yourself.
Number 4 can get complicated as you can't legally transfer to a person in another state without going through an FFL, and in a growing number of states you can't legally transfer within a state without going through an FFL.