They were commanded to pray inside Their Homes

Allah tells us why He saved the Children of Israel from Fir`awn and his people. He tells us how he saved them. Allah commanded Musa and his brother Harun to take houses for their people in Egypt,

وَاجْعَلُواْ بُيُوتَكُمْ قِبْلَةً

(and make your dwellings as places for your worship,) Al-`Awfi reported that Ibn `Abbas said, while interpreting this Ayah: "The Children of Israel said to Musa, `We cannot offer our prayers in public in front of Fir`awn's people.' So Allah permitted them to pray in their houses. They were commanded to build their houses in the direction of the Qiblah." Mujahid commented,

وَاجْعَلُواْ بُيُوتَكُمْ قِبْلَةً

(and make your dwellings as places for your worship,) When Banu Israel feared that Fir`awn might kill them in their gatherings at their temples, they were commanded to take their houses as places of worship. The houses should be facing the Qiblah and the prayer could be in secret." This was stated by Qatadah and Ad-Dahhak as well.