
Castration will make very little difference if you DONT teach him that this is inappropriate behaviour.
My neutered boy will hump my leg in times of stress, when he is frustrated by something. I just have to look at him these days and he knows its not on.
It may be that what you are doing to try and discourage him is in fact making this a big game for him, so i suggest you look at that and see if there is a way you can make it completely unrewarding for him.
For instance if you are waving your foot/leg around and making a lot of noise that can be really quite fun for a dog.
Instead try saying NOTHING, but putting the dog out of the room for a few seconds as a 'time out'.
As Teri says, castration has a lot of downsides and sadly a lot of people dont seem to like to mention them. Castration before physical and sexual maturation is not to be taken lightly and may well have, as one of a few side effects, the effect of 'freezing' your dog as a puppy forever.
This will mean he finds it much harder to learn how to be an adult dog and to interact with other adult dogs appropriately. I have a dog who was neutered at 6 months and this is exactly teh case with him.
Em