How do I stop my dog from jumping on people? How do I stop my dog from pulling on leash?
These are common questions in dog training and when asked this I always reply "what do you want your dog to do instead?" Changing the question to "what do I want my dog to do" when training helps you both in teaching them the behaviour you want and them being able to successfully learn how to behave.
Dogs are smart but cannot read our minds. If our dogs are jumping up, us telling them off or pushing them down isn't letting them know what we want them to do. We actually have enforced the behaviour by giving them attention as well as they may not know the meaning of the word off, to them it could mean hello. If we change our training to teach them to sit for our attention every time, we have set them up for success and taught them the appropriate behaviour.
Try changing your perspective next time!