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 stood behind him. He led those behind him in one cycle with two prostrations, then they advanced and took the place of their companions, while the others came forward and took the place of the first group. The Messenger of Allah ﷺ then led them in one cycle with two prostrations and gave the closing salutation. So the Prophet ﷺ performed two cycles, while each group performed one.

Azami 2914

Sahih

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

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

الأعظمي 2914صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Prayer of fear
Section
Whoever said, "In fear there is one rakat"
Numbering
Jami al-Kamil 2914 (2nd edition)
Azami 2914