Abdullah bin Masud reported,

The Messenger of Allah ﷺ led us in the prayer of fear. We formed two rows, one row standing behind the Prophet ﷺ and another row facing the enemy. The Messenger of Allah ﷺ prayed one rakah with the row directly behind him, then they stood up, moved away, and took the position of the others facing the enemy, while the others came forward and took their place. The Messenger of Allah ﷺ then prayed one rakah with them and gave the salutation. After that, the second group stood and prayed one rakah on their own and gave the salutation, then they moved away and took the position of the others facing the enemy, while the first group returned to their original position and prayed one rakah on their own and gave the salutation.

Ahmad 3561

Sahih

حدثنا محمد بن فضيل عن خصيف حدثنا أبو عبيدة

عن عبد الله قال

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

أحمد 3561صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abdullah bin Masud
Numbering
Darussalam 3561
Ahmad 3561