He's just marking them as his! You can try crating him and when he does come out, make it a very controlled situation where you have your eye on him at all times and can grab him if he ststrs to try. You may want to have him locked up and only bring him out if you ask the guests first. Let him meet them on a leash, then take him back to his crate.
Keep a leash on him. When the guests come in, give them treats for him. Don't let them touch or pet him unless he sits. Stand on the leash so that whenever he jumps up, his collar and the leash hold him down on the ground. IF he can get his forepaws off the ground, you need to tighten the leash up. When the guests aren't over, you need to always make sure that he sits before you pet him, feed him, everything. So he learns that only when he sits down does he get attention.
well what you just put down is a good idea but letting your dog see that some one is there and isolating them is as a good way to make an anti social dog. instead of putting you dog on a leash try stoping it before it happens you already should know you dogs behavior habits let him know that it is wrong when you see him thinkig about it prevention is a good way to kill bad habits OR maybe he just dont like your friend and is trying to tell you or maybe he just letting hem know