The best thing to do is change how people behave when they come in as well as how your dog behaves.
Be prepared ahead of time. Tell the guests what they must do.
Keep a jar of REAL treats by the door (not boring dry milkbones, maybe string cheese of another HIGH VALUE treat).
YOU answer the door and have you dog back off. Be best if you already attended dog classes and your dog respects you enough to 'sit' but if you haven't trained that yet we can still work on the behavior.....
Ignoring the dog (but having it keep it's sit if you have that trained reliably) but YOU opening the door, YOU happy and greeting the visitor and then YOU handing over the yummy treats to the guest.
Then, best would be your dog continuing it's 'sit' but if you haven't trained that DO NOT FOCUS ON THE SIT (you need to train that later) instead just have your friend place the treat in their OPEN hand and have that hand come in low for the dog to see/smell/take the treat. Want an open hand like when feeding a horse so it forces the lowered (less threatening hand) or otherwise the treat will just roll off.
You want the dog to lick the treat from the new persons hand to LINK the super yummy liver/cheese/chicken/beef with new people and their smell. New people you allow in the house = SUPER YUMMY TREATS.
None of what you are describing is weird at all. It's 100% normal for an insecure dog that isn't sure what to do, is upset with the new person coming in, and you haven't been able to redirect and teach him what he should be doing.
Just the fact you are seeing this as his 'inner guard dog'
is part of the issue. Because part of you may be thinking you WANT this behavior because any mass murderer would be in trouble.
Problem is, the number of mass murderers coming into the home are probably much lower than guests and friends. So to prepare and allow the mass murderer type reaction is confusing your dog.
LEADERSHIP and confidence in you is what is missing. When our dogs get we are in charge they look to us and follow us. So when I've done tons of normal socialization and training with my dog in and outside the home, they know how I react, when I am normal, know to follow my lead cause I HAVE GOT IT! They can back down and calm down cause I'm showing them life is fine.
So have you had your dog out of the house and met hundreds (thousands? ) of people? Is he fine, 100% calm taking a nap after a short time.... fine in these situations?
How have dog classes gone? Is he calm and focused taking cues from you in class?
If the only place you are still having trouble is in the home that means that YOU are acting differently in the home. Taking charge in public but leaving it to him in the home to decide to do whatever he wants in case his 'inner guard dog' is suddenly needed.
Great site with links and info ---> Why bother to 'socialize' and I want photos/videos of puppies/dogs.....