An anteroom is an outer room which connects with the interior of a structure. The defining feature of an anteroom is that it has at least one door which connects with the outside, and another door which leads into a room which is not in contact with the outside. In many cases, anterooms connect to several interior rooms, but they are not classified as hallways, because they are functional rooms, rather than elongated passages.
You may also hear an anteroom referred to as an antechamber, a waiting room, or a vestibule. The anteroom has a venerable history in architecture, with such rooms being common in Ancient Greece and Rome, India, and China, especially in temples. In temples, the anteroom held petitioners while they waited for audiences with priests or religious icons, and often space was provided to make offerings to the temple, for those who felt so inclined. In private homes, anterooms isolated the dwellers from the noise and odors of the street, and provided a space for visitors to wait while residents prepared themselves.
Because anterooms span the distance between inside and outside, they often have a very transitional feel. In a no-shoes household, for example, people may be encouraged to take their shoes off in the anteroom, and there may be a space to hang up coats and store bags. In cold climates, an anteroom can be quite useful, as it insulates the warm inner rooms of a house from the cold outside.
Waiting rooms in doctors offices and government buildings are often classified as anterooms, even if they don't connect to the outside, because of their function as transitional holding areas. Mudrooms and covered porches in private residences could also be considered anterooms, as they bridge the gap between the inner and outer world.
Anterooms also create a barrier between the inner sanctum and the outside world. As a general rule, if you are asked to wait in an anteroom, it is considered impolite to peer into the rooms which may be connected with the anteroom. In the case of a medical practice or government building, roaming visitors could breach privacy or security, which could be a problem. In a private home, people may not be fully prepared for guests, so waiting in the anteroom allows people to decide which room or rooms they want their guests to see.