Question: I sometimes daven in a shul where the aron hakodesh is on the northern wall. Some daven towards the aron while others face east. Which is correct?
Answer: The Gemara (Berachos 30a) writes that one should face towards Yerushalayim when davening the amida. Rambam (Tefilla 5:1) lists facing Yerushalayim as one of eight criteria for davening properly, though writes that if one doesn’t do so, they don’t need to daven again.
Additionally, Rambam (Tefilla 11:2) writes that when building a shul one should place the aron hakodesh on the wall that faces Yerushalayim to ensure that people face the aron while davening.
The Mishna Berura (94:9) writes that if one can’t place the aron on the Eastern wall, they should place it on the northern or southern wall, and daven facing Yerushalayim. One mustn’t place it on the western wall as those praying would have their back to the aron (See Biur Halachah 150:5; Shevet Halevi 10:20).
The Magen Avraham (OC 94:3) writes that if the aron is on the wrong wall, one should still face towards Yerushalayim. The Baer Hetev (OC 94:3) quotes the Yad Eliyahu (1) who writes that one should do so even if the rest of the shul are mistakenly facing the aron.Nonetheless, the Mishna Berura (94:10) writes that if one goes to a shul where people are facing towards the aron that’s on the wrong wall, one should face the same direction as everyone else, though turn one’s head towards Yerushalayim (See Aruch Hashulchan OC 94:13).