Jabir bin Abdullah reported,

The Messenger of Allah ﷺ led them in the prayer of fear. One row stood in front of him and another row behind him. He prayed one rakah and two prostrations with those behind him, then this group moved forward until they stood in the position of their companions, and the other group came forward and took the position of the first. The Messenger of Allah ﷺ then prayed one rakah and two prostrations with them, and gave the salam. So the Prophet ﷺ performed two rakahs, while each group performed one.

Nasai 1546

Sahih

أخبرنا إبراهيم بن الحسن عن حجاج بن محمد عن شعبة عن الحكم عن يزيد الفقير

عن جابر بن عبد الله

أن رسول الله ﷺ صلى بهم صلاة الخوف فقام صف بين يديه وصف خلفه صلى بالذين خلفه ركعة وسجدتين ثم تقدم هؤلاء حتى قاموا في مقام أصحابهم وجاء أولئك فقاموا مقام هؤلاء وصلى بهم رسول الله ﷺ ركعة وسجدتين ثم سلم فكانت للنبي ﷺ ركعتان ولهم ركعة

النسائي 1546صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Prayer of fear
Chapter
Prayer of fear
Numbering
Darussalam 1546
Nasai 1546