Try teaching your dog to go to a place when guests come in. It could be a crate, or a blanket or bed. Just like with any other training, you'll have to practice teaching them to go to this spot, and rewarding them when they do. Always use one vocal command, like place or bed, and walk them over to it. Have them sit on the chosen spot and immediately reward them. You'll have to do this many, many times, but they will eventually learn to associate the command and the reward with the chosen place. When guests come over, immediately give the command to go to their place.
This can help with the initial introductions and allow your guests to get in and get settled. Then ask your guests to give the place command. Allow them to reward your dog. Heping your dog associate strangers with structure will help to relieve the anxiety or fear that is causing him to bark. Once your dog has taken treats or a reward from your guest, then allow him to free roam. Keep treats on hand. Both you and your guest can reward your dog whenever he is quiet, calm, and nicely interacting with your guests.
It's less about trying to force him to be quiet and more about teaching him that there is nothing to fear and no reason to act defensively. Disciplining bad behaviour is not as effective as teaching good ones. If your dog knows what he is supposed to do, and knows that he will be rewarded with treats, toys, or attention, then he'll be more inclined to act appropriately.
I'd also recommend exercising him before guest come over. If you know you will have guest over, take your dog for a walk beforehand. Or play a game, like fetch, hide-and-seek, and even do some training. A mentally and physically stimulated dog will be less anxious.
I hope this helps! Good Luck!