Attentions And Prizes
Dogs, especially when they're still puppies, have similar reactions to human children: they act according to the environment and the education they receive.
If there are children at home, the owner of the puppy must make sure that the dog has the perfect surroundings so that they (the children and the puppy) can get along well. In the puppy's mind, he thinks that the child is another puppy and spends the whole day chasing the child. So, when an older person attends the child and doesn't pay attention to the puppy, he can start to feel a little jealous, which, obviously, you won't help with a swat; instead a little affection will do much better. Jealousy is a primary instinct that develops in both the puppy and the child; however, you cannot expect them to comprehend those feeling when we as grownups even battle those feelings at times.
When we understand that unwillingly we allow the puppy to feel jealous, a quick solution could be to have your child give the puppy one of his favorite cookies or biscuits. This will strengthen the bond between the dog and the child and will avoid any jealousy.
In the same way that you give the puppy a cookie or biscuit whenever you think he deserves it, you also have to scold him whenever he behaves badly.