Your 3 month old puppy doing a lot of the practice of humping. Humping is a subject that even seasoned dog owners hesitate to discuss perhaps because it can seem to be a hard habit to break. As your puppy nears 3 months, it's likely that he'll start humping objects and people.
You need to know that if your puppy is spayed or neutered, this is most likely not a sexual act. In the dog world, it is also used to signal power and rank and your pup is most likely trying to assert dominance. This is true for both male and female dogs.
To get rid of the problem you can do this. If your puppy isn't neutered or spayed, consider doing so. Besides many behavioral and health benefits, it will help curb this behavior. Again the thing is, the more a dog is exercised, the less likely he is to hump. If the humping is obsessive, your vet may recommend a medication. This calms your puppy and reduces libido.