Who are the exceptional people for whom the Rabbis permitted shaving and haircutting on Ch”H? The basic rule is as follows: If the circumstance under which one was unable to shave or cut hair before Yom Tov is revealed, then he is permitted to shave or cut hair during Ch”H. “Revealed” means that it is not simply a situation that occurred in the privacy of his home or awareness; rather, it is something big that the general public is aware of as well. If the circumstance is not revealed, then he is not permitted to shave or cut hair during Ch”H, even though he was unable to do so before Yom Tov for reasons beyond his control. For example, if the reason I could not get over to the barber before Yom Tov was because I was sick or because my car broke down, that is a private reason, and I am not permitted to shave or cut hair on Ch”H. If I arrived home late in the afternoon on Erev Yom Tov (and certainly on Ch”H itself) after serving a military term in Iraq, then I may get a haircut on Ch”H! (Ed. Bad example, because a soldier’s hair is always kept short!) If a person was involved in some other type of long-distance trip, he should ask a ‘shaila’ as to whether or not he qualifies for an exception. The advantage of the revealed reason is that people are less likely to draw erroneous conclusions by thinking, “Well, if he could do it, then why can’t I?” Here’s another exception: Getting up from shiva (r”l) on Erev Yom Tov which occurs on Shabbos (i.e. - if Erev Yom Tov was on a weekday, the avel/mourner would be permitted to shave and cut hair before Yom Tov after getting up from shiva that morning.)
Note: Even those with legitimate exceptions should try to do their shaving and haircutting in private, where possible.
Children (generally speaking, up until Bar/Bas Mitzvah age) are exempt from the decree, in cases of need, even if they do not have an excuse and even if the haircutting is done in public.
The decree against shaving/haircutting does not prohibit trimming one’s mustache, nor other forms of grooming or bathing, even when they cause hair to fall out. Shaving for medical reasons may be permissible; one should ask a shaila of his Rav.
Finally, here’s another exception from Hilchos Chol Hamoed ‘Zichron Shlomo’, by Rabbis Zucker and Francis, p. 44: “Although a man may not cut his hair or shave on Ch”H, a woman may tweeze her eyebrows and cut or shave any body hair except the hair on her head…”