dog high five
Sophie Jacques, Associate Professor, Psychology and Neuroscience, Dalhousie University, came up with some interesting figures on dogs recognizing words. Starting in 2015, she and a colleague
developed a list of 172 words organized in different categories (for example, toys, food, commands, outdoor places) and gave it to an online sample of 165 owners of family and professional dogs. We asked them to select words that their dogs responded to consistently. We found that, on average, service dogs respond to about 120 words, whereas family pets respond to about 80 words, ranging between 15 to 215 words across all dogs. We also found that certain breed groups, such as herding dogs like border collies and toy dogs like chihuahuas, respond to more words and phrases than other breed types like terriers, retrievers and mixed breeds.

Sophie Jacques, "Yes, Your Dog Can Understand What You're Saying — to a Point" at The Epoch Times (January 22, 2022)
There is a practical value to Jacques's work with dogs and language:

Sophie Jacques

Sophie Jacques
... it is very expensive to train puppies for service work and many do not make the final cut. However, if early word-based responding abilities predict later behavioural and cognitive abilities, our measure could become an early and simple tool to help predict which dogs are likely to become good service animals.The Conversation

Sophie Jacques, "Yes, Your Dog Can Understand What You're Saying — to a Point" at The Epoch Times (January 22, 2022)
Of course, the dog is responding to words as signals, not as components of sentences.

What dogs are really good at is picking up on and responding to human emotions:
Just as human toddlers look to their parents for cues about how to react to the people and world around them, dogs often look to humans for similar signs. When their people project feelings of calm and confidence, dogs tend to view their surroundings as safe and secure.

"The emotional connection between humans and dogs is the essence of the relationship," says Clive Wynne, a professor of psychology and director of the Canine Science Collaboratory at Arizona State University. "Dogs are amazingly social beings, so they are easily infected with our warmth and joy." But the converse is true as well, which means their owner's stress and anxiety can also become the dog's stress and anxiety.

Stacey Colino, "Yes, dogs can 'catch' their owners' emotions" at National Geographic (October 1, 2021) The paper referenced is open access.
Of course, that makes sense. The dog is living in a human environment and much of the time, he doesn't know for sure what to think, so he looks to his human friends for clues.
Sensory factors also can influence emotional contagion between people and their canine companions. For one thing, dogs have a remarkable ability to read the facial expressions and body cues of human beings, experts say. While some research has found that dogs focus more on bodily expressions of emotion than on facial cues in both humans and other dogs, other studies have shown that dogs process human facial expressions similarly to the way people do. A study in a 2018 issue of the journal Learning & Behavior found that dogs respond to human faces that express six basic emotions — anger, fear, happiness, sadness, surprise, and disgust — with changes in their gaze and heart rate.

Stacey Colino, "Yes, dogs can 'catch' their owners' emotions" at National Geographic (October 1, 2021) The paper referenced is open access. Both papers cited are open access.
Dogs find out what they need to know any way they can. In one recent study, researchers gave dogs a choice of getting help with obtaining food either from a human who had shown a positive expression or one who had shown a negative expression:
The study involved presenting the dogs with a social interaction between two unfamiliar people, which could be positive (happy), negative (angry) or neutral (did not display a particular emotion). After witnessing the two people engaging silently with each other, the dogs were given the opportunity to approach food that varied in how easy it was to access. It was either freely available or the dogs needed the humans' help to get the food. At the time of their choice, only neutral expressions were displayed, so the dogs had to use their knowledge about the meaning of the humans' previous emotional expressions to decide which course to take.

First author of the study, Dr Natalia Albuquerque, an animal behaviour and cognition scientist from the University of São Paulo, said, "We found that dogs generally chose the human that had shown a positive expression and avoided the human that had shown a negative one. Moreover, the available emotional information was more important when the dogs could not reach the food by themselves and had to get help from the humans, meaning that they were taking into consideration the emotions displayed by each person.

News Staff, "Your Dog Does Understand You - They Use Your Emotions To Predict Your Actions Much Like People Do" at Science 2.0 (September 23, 2021)
Left to himself, the dog would probably prefer to use information like emotional expressions rather than words; for one thing, he shares many emotions with humans. Emotions may be the one thing he really understands in many cases. On the other hand, learning word cues about things that concern him makes it easier for him to understand what is going on among the humans.