Yawning is a form of dog body language. When you see your dog yawning, there's a good chance he's trying to communicate with you.
What It Is
Yawning in dogs looks just like it does in humans - wide-open jaw accompanied by a big, deep breath. While with people, we usually associate yawning with fatigue, when dogs yawn, it can sometimes also be a form of communication.
What It Means
Yawning is a type of appeasement gesture; something also referred to as a calming signal. Dogs yawn to deflect a threat. If a person or another animal approaches a dog, that dog may avert his gaze and yawn. It's a dog's way of saying that he feels threatened or anxious, but that he is not going to attack. Dogs use this type of body language to avoid conflict.
Keep an eye on your dog, and you may catch him yawning. It could happen if two children are fighting close to where the dog is lying down, if a child hugs him, when someone scolds him, or in a variety of other stress-inducing situations. Being aware of what causes anxiety in your dog can help you prevent him from being exposed to those situations.
Romero T, Konno A, Hasegawa T. Familiarity Bias and Physiological Responses in Contagious Yawning by Dogs Support Link to Empathy. PLoS ONE, vol. 8, no. 8, 2013. doi:10.1371/journal.pone.0071365