Well good luck with that....! It's just something they do. You need to correct the behavior just like you would any other unwanted bad habits. Also dont be surprised if he even trys to hump your arm/leg etc.
I have dealt with this problem as well and I used Belly Bands. They do not stiop the behavior but stops penitration. not sure where to purchase them, I made my own. Here are some links that I fond...
Belly Bands for Dogs - Pet Shoppe Boutique PETCO.com - PlayaPup UV Protective Belly Band in Brown customer reviews - product reviews - read top consumer ratings