Why Do Dogs Put their Ears Back When You Pet Them or Look at Them?

Even though dogs can't talk like humans do their body language is a very reliable way to know what emotion they are currently feeling.
The most common and obvious body langauge people look for when reading a dog's body language is their tail. Everyone who has come in contact with a dog has noticed the tail movement. It is very clear that if the pup is happy to see you the tail will be wagging back and forth. Especially if you are just getting home after a long day of work their tail can turn into a whip! (depending on the size and breed of course)
The other part of the dogs body that are clear signs of their body language are the ears. The ears might actually tell you more about the dog's emotions than the tail. One of the common movements you will see is when the dog puts their ears back when you pet them or look at them.
To get even more specific their are different varieties of how a dog puts their ears back.
Ears Somewhat Back
This is usually a sign of the dog being in a good mood and/or relaxed. A lot of times you will see a dog's ears somewhat back when they are hanging out on their front porch while looking around and observing their surroundings.
Ears Totally Back
In this case the ears being totally back is a strong sign that the dog is very scared. There is a good chance you will see this happen during a thunderstorm or maybe even during 4th of July fireworks. The loud noises (which are even louder to the dog) put them in a state of fear. When the ears are totally back, dogs also tend to run away and hide somewhere. They usually hide somewhere like under a table or even someone's legs if they can fit.
Ears Back and Down
If you ever came home to a pile of torn up garbage spread throughout the kitchen floor and asked your dog "Did you do this?!?" you probably noticed their ears going back and down. This is a combination of guilt and submission. It is also common that the ears going back and down is followed by the dog laying on its back. The dog is showing that they are well aware of their wrongdoing.
Knowing how to read your dog's body language will give you a better understanding of the emotions they are feeling. This knowledge will help you know them better so there will be less confusion when trying to know how they feel in certain situations.
Sources: