Jabir bin Abdullah reported,

The Prophet ﷺ led his companions in the prayer of fear. He bowed with all of them together, then the Messenger of Allah ﷺ prostrated along with the row directly behind him while the others remained standing. When he rose, those others performed their two prostrations on their own. Then the front row moved back to take the place of the rear row, and the rear row advanced through them to take the place of the front row. The Prophet ﷺ then bowed with all of them together. The Messenger of Allah ﷺ prostrated along with the row now directly behind him, and when they raised their heads, the other group performed their two prostrations. So all of them had bowed with the Prophet ﷺ, and one group had performed two prostrations on their own. The enemy at that time was in the direction of the qiblah.

Ibn Majah 1260

Sahih

حدثنا أحمد بن عبدة حدثنا عبد الوارث بن سعيد حدثنا أيوب عن أبي الزبير

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

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

ابن ماجه 1260صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Establishing prayer and the sunnah regarding it
Chapter
Prayer of fear
Numbering
Darussalam 1260
Ibn Majah 1260