Hi, Here's a training method I've seen from dog trainer Victoria Stilwell. It helps to have other people in the room to tell you how he responds.
As you enter the room and your dog begins jumping or biting, turn your back to him and cross your arms. It may take a few moments, but he will stop when he sees you're ignoring him and not interacting whatsoever. Take a few steps away if necessary. When someone else tells you he has calmed down, turn to him and praise him verbally or with a treat. But, if he immediately begins unwanted behavior again, immediately turn around. Repeating this consistently teaches him he will get attention, praise and treats only when he is calm and friendly. Your friends and guests should do the same thing. Ignore him and move away when he misbehaves and praise him when he's calm. If he jumps on people sitting on the couch, the person should get up and move away. Victoria is successful with this whether it's mild aggression or more advanced. She uses alot of good boy, good girl and never needs to shout.
Also, petting a dog on top of his head shows dominance by you. For a more neutral or positive response from him, approach him from the side or underneath and don't look him in the eye. He will see this as a challenge from you. Eventually when he becomes social and friendly enough, above the head petting and directly looking at him should be ok
Let us know what happens!