Looks like your pig is winning the battle of "Who's the Boss" in your house!
The one thing you must do is to make sure if the pig pees where you don't want it to, you must remove all scent of it from that spot!
Otherwise if he smells it, he'll keep doing it!
As for rooting your leg, he has no other way of getting your attention. If you give him attention or food after he does that, then he has YOU trained!
When ours started doing that, my wife would scratch or feed her and that only encouraged her to do it more! Then we started ignoring her when she did that and pretty soon she quit doing it so much. But when they really need your attention, they don't really have any other way of getting your attention but to nudge with there nose!
You can't let your pig get away with bad behavior!
Peeing outside of it's designated area must be dealt with imediatlely!!
If you must, rub it's nose in it's mess while screaming "Shame!". Then put it in it's litter box or take it outside!
You will still have to scrub that spot to get rid of the oder though!
Also, is your pig neutered? If not, could he be marking his territory?
We had to have our female pig spayed because she would proudly pee right in front of us when she came into heat!
It's just what they do (behavior) in their reproductive cycle.