A lot happens to a puppy that shapes it for the rest of its life from birth to 8 weeks old. Most dog owners never see or could even imagine. Thats one reason to avoid puppy mills and go to a good local breeder where you can inspect and see how they treat their pups. You are way behind the curve dealing with this at two years old he was alot more to unlearn. Its a lot easier to raise a baddog then a good one.
When you say he has never been beat or yelled I take it to mean you have never abused him. It does sound like he has some kind of trama, be it mental or physical. Do you have kids, is the wife home with him during the day? Have you left him with someone else to watch? When he got fixed how did that go ? I worked with a dog who never got over being fixed became very aggresive and had to be put down. Some dogs deal with it different ways.
The pelvic air thrusting for a male that isnt around a female in heat is strange. I dont know what to say because that normaly would be a dominant thing and the pissing is a submissive behavior. You dont live next to anyone breeding dogs do ya ?
He needs his confidence built up. As other have said wait until he comes to you and even then dont make a big deal, a pat on the head if he doesnt pee he gets a treat all this is very NON exciting and nonshalant like way. He will come to you sonner or later.
The bad part is it will take time and effort from you. One of the easest ways is to raise his confidence is to just teach him the normal dog tricks sit,heel,down,come etc...... Praise and treats are the best ways to teach him. You want build his confidence up so any harsh tone or smacking will be counter productive.
Does he get around other dogs ? If not try to get into a class or go to a doggy park and see how he interacts with other dogs. Does every dog punk him or does he stand his own in the butt sniffing fest ?
You may be able to build his confidence if he holds his own against a few other dogs in a play session.
Summary : Start slow and on his level. Take it slow and calm. It could take a year before you see good progress.
I helped trained a puppy that was worse, frieghtened of everything people,doors,cars,cats,phone you name it she would piss if it made noise or moved. That was at 10 weeks old so the owners worked with her by waiting for her to seek them out, acting calm and making her feel safe. At 4 months old they took her to puppy class twice a week for an hour the class lasted 6 weeks. The owners worked with her very little during the rest of the week. She improved alot in class due to the contact with other dogs. 6 months later she was still weird about alot of stuff but much better dealing with people. She was 2 years old before I would say she was a close to normal dog. She turned out to be one of the best looking Rotties I have ever seen. The owners never showed her because of her mental state but they say she turned out to be the best family pet they ever had.