
My old dog is 14 yrs now, we got him when he was 4. He was an awful 'humper', visitors legs, our legs, the kids, nothing was safe - he would even drag the cushions off the sofa & hump them. We had him castrated when he was 7, but that alone didn't stop him humping. We discovered that his humping was mostly a dominant thing and the rest of the time just for 'fun'.
At the time we were stupid enough to think that this behaviour was funny and never really did much about it at first, infact I'm ashamed to say we actualy encouraged it. It was his 'party trick', if we pointed at something and said 'humpy humpy', sure enough he would go hell-for-leather on it.
But by simply by stopping him when he tried to hump things we sorted it out. Occasionally (even at his ripe old age) if he gets
really exited, ie. the kids are running around like loonies shouting & screaming, he still will try and hump his bedding.
At your pups age, it shouldn't be to hard to get him out of this habbit. As other have said, it's not neccessarily down to sex drive or domminance, exitement can be enough. But it is best to start to curb this now.