I have noticed first-hand that some dogs freak out when certain people are around (barking, squeaking/squealing, fidgety, stressed-like, etc.), but then when I come around those exact same dogs they are perfectly calm.
For example, my brother comes to visit, comes inside the house and the dog will start barking viciously, but if I do the same exact thing (with the dog a distance from the door and unable to see) the dog will not make a peep. Also, sometimes the dog will get aggressive or stressed out when certain people get near them, but most dogs I get near never act this way, and are usually calm.
Why is it that some dogs freak out, snap, stress out, get angry, etc. around certain people (even those they may see often), but to others, like me, they are usually soft, more relaxed, calm, etc.?
I had first proposed a theory that maybe it had to do with the dog's observation of the human's behavior. But I don't think dogs are too complex in their brains/reasoning to be able to recognize variating moods, and doubt they can read emotional intelligence that well(if at all).