Sitting in a Place Designated for Prayer
One who is already sitting down does not need to stand up if someone else comes and stands next to him while praying the Shemoneh Esrei, since the latter has entered into his space (Shulchan Aruch 102:3). Haga: Nevertheless, even though one is not required, it is considered pious to stand up in this situation.
The above ruling is brought by the Tur, in the name of his father the Rosh. In explaining the application of this rule, the Kaf Hachaim writes that according to the Tur there is no difference whether one is praying in shul or at home. In all cases, if the person was already sitting he does not need to stand. This also seems to be agreed upon by the Shulchan Aruch.
However, the Bach, in his comments on the Tur, explains that the above rule applies only when one prays in a place that is not designated for prayer, like a home or the like. If, however, one was praying in a place designated for prayer, like a shul, then even someone already sitting would be required to stand up, since a person does not have the right to hinder one from praying in a place designated for prayer. Accordingly, in this case it is considered as though the person sitting is intruding into the space of the worshiper. The Magen Avraham, Gra, Shulchan Aruch Ha'Rav, Aruch Ha'Shulchan, Mishnah Berurah and many other poskim all rule in accordance with the Bach.
A question, however, arises regarding Sefardic Jews. Since they have accepted to follow the ruling of the Shulchan Aruch, in this case it would seem that they would be allowed to remain seated even if someone was praying next to them in a shul.
Regarding this point the Halacha Berurah, (by Rabbi David Yosef) explains that even though the opinion of the Shulchan Aruch is not to limit permitting one to remain seated only to a place not designated for prayer, one should be strict and stand up when someone prays next to him in shul, in accordance with the overwhelming majority of poskim, including the Chida, Ben Ish Chai, Kaf Ha'Chaim (Sofer) and Rabbi Ovadia Yosef.
Another reason mentioned by Rabbi David for being strict is that there is a “double doubt”, which requires one to be strict. The first doubt is a result of a dispute among the rishonim. Rabbi Manoach (in his commentary on the Rambam) disagrees with the Rosh's qualification allowing one who is already seated to remain seated; and even if the law is like the Rosh on this point, perhaps the law is like the Bach and not the Tur.