Training your dog takes three basic rules:
Patience- It takes time for your dog to learn a new command or behavior. If you are patient and give them time to make the association between what you are commanding them to do and the appropriate behavior for that command, you and your dog will be successful.
Clarity- It is your job to make sure you are sending a clear message to your dog. Dogs do NOT understand verbal languages!! People as well as animals communicate using body language. So, when teaching your dog a new command it helps to also give them a hand signal for that command. ie say "sit" and hold your index finger pointing upwards as your hand signal at the same time. This gives your dog a body language to read while hearing the word "sit". Once the dog learns the behavior for each command you will be able to remove one or the other. ie, only saying "sit" or only using the finger pointing up, without saying "sit" and the dog will respond by sitting. Dogs will typically learn faster and more accurately because you are being clear.
Consistency- Most unwanted behaviors from dogs are self rewarding. Example " jumping to get attention" the attention may be good or bad that you give, but it is still attention. Most dogs will not miss the chance to engage in these self rewarding activities.
Consistently detouring the dog from doing the unwanted behavior and consistently rewarding their good behaviors is setting your dog up for success.
If you only teach a dog to sit for attention sometimes, but not ALL of the time you are creating confusion for them and the bad behaviors will never stop.