The Messenger of Allah ﷺ led his companions in the prayer of fear. He arranged them behind him in two rows. He prayed one rakah with those nearest to him, then stood and remained standing until those behind them had prayed one rakah. Then they moved forward and those who had been in front moved back, and he prayed one rakah with them. He then sat until those who had stayed behind had prayed one rakah, after which he gave the closing salam.
أن رسول الله ﷺ صلى بأصحابه في الخوف، فصفهم خلفه صفين، فصلى بالذين يلونه ركعة، ثم قام، فلم يزل قائما حتى صلى الذين خلفهم ركعة، ثم تقدموا وتأخر الذين كانوا قدامهم، فصلى بهم ركعة، ثم قعد حتى صلى الذين تخلفوا ركعة، ثم سلم.
Bukhari narrated it in Maghazi (4131) and Muslim in Salat al-Musafirin (841:309), both through the route of Shuba, from Abdul-Rahman bin Qasim, from his father, from Salih bin Khawwat, from Sahl bin Abu Hathma, who said, "..." He then narrated it. The wording given is Muslim's. Bukhari did not present his own wording but instead referred back to the wording that preceded it, though his version is mawquf (stopped at the companion).Bukhari narrated it in Maghazi (4131), from Musaddad, who said, Yahya bin Saeed Qattan narrated to us, from Yahya bin Saeed Ansari, from Qasim bin Muhammad, from Salih bin Khawwat, from Sahl bin Abu Hathma, who said, "The imam stands facing the qibla, with one group with him and another group facing the enemy, their faces turned toward the enemy. He prays one rakat with those who are with him, then they stand up and each performs one rakat on their own and prostrates twice in their place. Then this group goes to take the position of the other group, and that group comes and he prays one rakat with them, giving him two rakats in total, then they perform their rakat and prostrate twice."