In a 5 month old puppy it isn't dominance nor sexual in nature. It is more likely a behavior the pup is exhibiting because it isn't sure what behavior is expected of it. It is excited (play) and is unsure how to proceed.
It isn't an acceptable behavior and needs to be corrected - but you need to make sure the pup is aware that it's not being corrected for the what caused the behavior (wanting to play). The best thing to do is make it a non-event. When the pup starts to hump just gently push it off and say 'quit', then continue to play. Making it an event by laughing or shouting for someone to come see (etc.) could be understood as a reward for the behavior to the pup.
Hondo Von Dopplet L Bauernhof "Hondo"- GSD
Lilie's Tug McGraw "Tug" - Golden Retriever
Maggie - Mini Dachshund (Rescue)
Lonestar Pivo - Texas Blue Lacy
Ashe - Barn Cat
Katie / APHA