Am I correct to assume he hasn't been socialized that much? Or maybe he has but not enough? The puppy (by general and broad rule of thumb) should interact with 100 people by 4 months. Growling and barking at people within your own home means the puppy is defensive and bit insecure. Which is somewhat reasonable from a young puppy but at 6 months going on 7 this behavior needs to be nipped asap. Especially because at this age, they are already getting much bigger, have the attention and focus and mental capability to understand your wants and to be trained appropriately.
The opinions may vary but I also think that there is some truth to the fact that the dog does not believe you to be the leader. Call it what you will "pack leader", "alpha", "leader", "daddy", whatever it is. He's calling the shots, he's becoming defensive and addressing strangers. But don't misunderstand, trying to outalpha your dog with corrections will only mitigate the problem a little bit if it's a socialization issue. And vice versa. Just curious, is he crate trained? Does he pull on the leash when you walk? Does he sit on your furniture and on your couch without your approval? Have you ever had him sleep on the couch and woken him up and told him to get off? Did he? Or did he look at you and ignore you or worse, growl? Does he have any food aggression issues?
I would look for an entire change in the dynamic of your relationship with the dog and start crate training if it hasn't happened already. Teach door manners, start NILIF training. Make the dog work for the food, walks, going outside, etc. Don't do anything when the dog asks or whines. Do you it on your terms. I make my dog sit before I give her water after exercise, before meals, before any treat. I make her sit before we leave the door. She was a little mischievous as a younger puppy and still is (5 mo old now) but now I can leave the door open and she will not go out. If she sticks her head out, I correct her verbally and give her a command. Simple No and "Back" will suffice. but the reason why it works is because she knows my so-called "threats" or verbal warnings to her are backed up 100% of the time. She knows if I have to repeat myself 3 times, I'm going over there to her, 100% of the time. Flu or cold, eating dinner or laying down watching a movie, I get up and address the issue 100% of the time. So you can say I'm strict but I'm not mean. And it's because that she knows I will back up what I say, I can simply whisper "lucky... no..." and she will look at me and listen.
The one thing I do not tolerate in my house is barking or growling. And because I have such a peeve with barking I made sure to have bunch of different people (tall, short, with hats, no hats, groups, thanksgiving dinner, etc.) come over. She goes potty in the front yard where there is a school field and there are other dogs, people on walks, playing soccer, etc. She was exposed to this environment of people coming and going since she was young and so she absolutely loves people. too much in fact.
I'm not sure where you're located but I have a good training formal obedience school if you're in Southern California. Good luck