
Also a 14 year old stranger would not be perceived as a child and trying to hug a dog just reaching maturity would be perceived as either threatening or dominating and rude, so he told her to get out of his face in teen speak.
This can be a difficult time for maturing dogs when they are trying to establish their role in the gradn scheme of thigns. As he is now adult you may have relaxed a bit with his training and he has just got a bit above himself, which he might not dare demonstarte with family, but thought it fair to your daughters freind.
To be honest a dog should not be hugged by non family members unless the dog is seeking the attention.
Imagine visiting one of your freidns who your daughter didn't know well, and they gave her a big hug, as a tenager whe would most likely not be impressed, and adult would take it in their stride.