Due to the considerable significance and sanctity of the Amidah prayer, the Chachamim prohibit sitting within four amot of a person who is praying. One reciting the Amidah is standing before the Shechinah, and anyone sitting there idly is seen as someone who does not accept the yoke of Heaven upon himself, thereby desecrating the place of prayer.
However, one who is engaged in a section of prayer is permitted to sit next to a person reciting the Amidah, for since he is engaged in prayer, he does not appear as one who does not accept upon himself the yoke of Heaven. Some say that one who wants to learn Torah is also permitted to sit next to a person praying. In times of need, for instance when a person cannot focus on his learning while standing, it is permissible to be lenient and to sit (Shulchan Aruch 102:1; Mishnah Berurah 6).
If he sat down next to the person praying before that person started to recite the Amidah, although he is neither praying nor learning he is permitted to continue sitting there. This is allowed because he does not disgrace the prayer, rather it is the person praying who did not act in accordance with the law by beginning to pray within someone else’s four amot. Even so, it is, indeed, a righteous act to show respect for the prayer by standing up, or at least by learning Torah or reciting Psalms (Shulchan Aruch, Rama 102:3).
A weak or frail person, even when not engaged in prayer, is permitted to sit within another person’s four amot, since everyone knows that it is because of his weakness that he needs to sit, and therefore there is no offense to the respect of Heaven (Shulchan Aruch 102:2). On Yom Kippur, almost everyone is considered to be weak because of the fast, and therefore it is permissible to sit within four amot of a person praying (Beit Baruch 26:9).
There is a stringent opinion which maintains that it is forbidden to sit directly in front of a person praying, even if he is outside of one’s four amot, since it causes the person who is praying to appear as though he is bowing down to him. Therefore, even if he is reciting Keriat Shema, and he sat there before the other person began to recite the Amidah, he must stand. L’chatchilah, it is good to follow this opinion (Shulchan Aruch 102:1; Mishnah Berurah 9; Kaf HaChaim 10).
The measurement of four amot is approximately two meters (6.56 feet). To be more precise, an amah is approximately the length of the average person’s arm. According to the majority of poskim, it is approximately 48 cm (18.898 inches), which means that 4 amot is approximately 192 cm (75.59 inches). However, there is obviously no need to measure the exact distance from the person reciting the Amidah; instead, every person must practice according to his own visual estimation.
. The Ohel Mo’ed is stringent, and there are those who do not take his opinion into consideration, as written in Pri Chadash. Ben Ish Chai, Yitro 6, writes that the custom is to act leniently, as writes Yalkut Yosef 102:2. However, many Acharonim are stringent, as both the Mishnah Berurah 102:9 and Kaf HaChaim 10, write. Even to stand in front of him within his four amot, l’chatchilah is not proper, so he does not appear to be prostrating himself before him, see Mishnah Berurah 102:8-9. The measure of approximately “within a person’s eyesight,” concerning the matter of getting up for a talmid chacham, is defined in the Shach, Yoreh De’ah 244:8 as 266 2/3 amot (approximately 128 meters; 419.95 feet). However, it seems that in any case in which the person reciting the Amidah does not appear to be bowing down to the person in front of him, either due to the distance between them or the conditions of the area, there is no need to be stringent.The Mishnah Berurah 102:2 writes that if there is a partition with a height of 10 tefachim (80 cm; 31.49 inches) and a width of 4 tefachim (32 cm; 12.59 inches) between the person praying and himself, he may sit. Although a partition cannot be used to allow someone to pass by the person praying, since passing by will disturb his kavanah, sitting is nevertheless allowed, since for that, the partition is effective. According to the Chayei Adam and Eshel Avraham (Butshatsh), when there is a partition, one is even allowed to pass by the person praying. However, it seems that it is proper to be stringent regarding sitting directly in front of the person praying, so that he will not appear to be prostrating himself before him.
I did not differentiate between the sides of a person and behind him. However, see Beit Yosef and Darkei Moshe who explain that some poskim rule that there is no prohibition against sitting behind a person praying, even within his four amot. Still, in practice, the Acharonim agree to forbid sitting behind him, as explained in the Mishnah Berurah 102:3 and Kaf HaChaim 4.