Sayyiduna Sahl bin Abi Hathmah (may Allah be pleased with him) says about the prayer of fear: "The imam stands facing the qiblah, and a group stands on the side of the enemy, with their faces towards the enemy. The imam leads those who are with him in one rak'ah, then remains standing, and they complete one rak'ah on their own, bowing and performing two prostrations in their place. Then these go to the place of the others, and those others come, and the imam leads them in one rak'ah. Thus the imam's two rak'ahs are complete and they have one. Then they bow on their own and perform two prostrations."
Hadith Referenceالمعجم الكبير للطبراني / باب السين / 5610