Who is obligated in the three pilgrimage holidays of Pesah, Shavuot and Sukkot?
In several places (see, for example, 16:16) the Torah commands all Jewish males to participate in this mitzva. The first Mishna in the Massekhet lists the people who are not obligated. Specifically:
people who are mentally deficient (in Talmudic terms, someone who is deaf-mute, an imbecile or a child),
people who are not male (this includes not only women, but also people of uncertain gender)
people who cannot make the trip, like a sick or aged person, or someone who “cannot go up on his legs.”
The cases of uncertain gender are the situations of a tumtum and an androgenus who are not obligated to participate in aliya la-regel. Both of these groups are people whose gender is unclear, the tumtum because we cannot tell whether it is a man or a woman, and the androgenus who shows both male and female sexual organs (hermaphrodite).
How to interpret the case of “someone who cannot go up on his legs” is the subject of some debate among the rishonim. Rashi presents it as a case where the individual cannot walk from Jerusalem to the Temple Mount. Tosafot point out that Rashi is offering the most radical case; a person who cannot make it from his own town to Jerusalem would certainly fall into this category, as well. The Rambam claims that this exemption in the Gemara refers to someone who is uniquely sensitive and never walks anywhere. Others suggest that this refers to someone who cannot walk around barefoot, since wearing shoes into the Temple is forbidden.
Finally, Tosafot point out that the list in the Mishna is not exhaustive. There are additional cases where an individual’s personal situation or even his profession may free him from the obligation to travel to Jerusalem.