The Messenger of Allah ﷺ led them in offering the fear prayer. One row stood in front of him and another row stood behind him. He led those who were behind in prayer, bowing once and prostrating twice, then they moved forward until they took the place of their companions, and the others came and took their place, and the Messenger of Allah ﷺ led them in prayer, bowing once and prostrating twice, then he said the taslim, so the Prophet ﷺ had prayed two rak'ahs and they had prayed one.
أَنَّ رَسُولَ اللَّهِ ﷺ صَلَّى بِهِمْ صَلاَةَ الْخَوْفِ فَقَامَ صَفٌّ بَيْنَ يَدَيْهِ وَصَفٌّ خَلْفَهُ صَلَّى بِالَّذِينَ خَلْفَهُ رَكْعَةً وَسَجْدَتَيْنِ ثُمَّ تَقَدَّمَ هَؤُلاَءِ حَتَّى قَامُوا فِي مَقَامِ أَصْحَابِهِمْ وَجَاءَ أُولَئِكَ فَقَامُوا مَقَامَ هَؤُلاَءِ وَصَلَّى بِهِمْ رَسُولُ اللَّهِ ﷺ رَكْعَةً وَسَجْدَتَيْنِ ثُمَّ سَلَّمَ فَكَانَتْ لِلنَّبِيِّ ﷺ رَكْعَتَانِ وَلَهُمْ رَكْعَةٌ