First question - is he neutered? He is in his sexual prime and might be feeling the need to claim anyone he likes, or feels is a threat to his territory.
Next - he is marking the people he is trying to impress. He is saying "I could own you - see I have marked you with my scent". Now the unfortunate part is when someone stands there not noticing or correcting his very poor manners. Then he thinks - "that was easy, you let me mark you. Aren't I impressive?"
Because people aren't as aware as you will now be (embarrassment is such a good teacher!
) - it is up to you to teach him better manners.
I would not let him run loose just yet and teach him how to greet people with good manners - ideally sitting for attention. Each person he meets has a personal space - unfortunately he is willing to intrude on that space and take it one step further - pee on them! So we have to teach him to respectfully keep his distance from people until he can show us that he is able to make better choices.
Does he know the direction 'leave it'? It would be good to start teaching him to leave things alone - it means that he should pull his energy back from the item, not even look at it.
Here is how you will begin to teach this...
The "leave it" command would be perfect for this situation. Teach it in the house first. Get him to "leave it" with all of his favorite toys, treats, etc. This tells him to back away from the very thing he might be interested in - before it becomes a 'drop it' issue. Start with objects/food that he might want and put it in the middle of the floor and then move on to dropping things intentionally on the floor in front of him. Have him on the leash to ensure success. Tell him to 'leave it' in a firm tone and if he goes for it step between him and the object with a stomp (throwing energy towards him - to get him to back off), and/or add a slight correction on the leash as you say 'leave it' again. Pretend in your mind that the object is a snake and he absolutely can't have it. Use whatever energy that evokes in your voice and body language to get him to leave it alone. Then, while he is still on the leash, place the object between you and the dog, and call him to come. He should put his own imaginary circle around the object as he comes to you. Now he is respecting your word and understanding that everything is not his to grab, but YOU determine what he can and cannot approach.
Catching him before he rushes to something can make a huge difference. It's easier to stop him before he makes his move than to have to stop him in mid-stride. This gives you a greater vocabulary to use with him as well. Which gives you the chance to 'talk' him through his choices. Be sure to praise him when he makes the good choices - so he is clear when he has done the right thing.
Then you are going to apply this to people - when he gets too close (close enough to lift his leg - you say 'leave it' in a firm tone and he should back away on his own. The subtle and wonderful message you are also conveying is that all things belong to you and nothing belongs to him - including people.