Is your dog food motivated? Does he know how to sit? My aunt had this problem with her 1 year old female. She gave a few family members and a few strangers some treats to put in their pocket. A family member walks in, automatically pulls 1 treat out of their pocket and tells him/her to sit. Usually when they see the food, they submit and want to be your friend. Than have a stranger walk in and do exactly the same thing 1 treat for the sit, with no barking, comand.
I hope this works. It helped us. after a week or two of doing this a couple times, she got the point. People are not bad 🙂