This is a normal behaviour. The remedy of this is same that's used on humans. You have to make your dog get comfortable when new people come to your home. You can bring in your friends whom your dog is not familiar with. You can take them to the same room you're dog is hiding and lock the door inside. Ask the guest to behave normally as if the dog doesn't exist in the room. Don't make any fuss, like calling him, stroking him at the back, etc. Just engage in a conversation and ignore the puppy completely. This way your puppy will be able to get out of his fear because you're behaving as normal. Once your puppy starts to socialise with those people, try to bring in more people and notice if he's behaving normally with them. In most cases, the puppy does behave normally. If not then, you can enfore the same technique as discussed earlier. Slowly and gradually, he'll be used it.
Use this method for a month or so and then let us know what happened.