Abdullah bin Umar reported,

The Messenger of Allah ﷺ performed the prayer of fear on one of his expeditions. One group stood with him while another faced the enemy. He prayed one rakah with those who were with him, then they departed and the others came, and he prayed one rakah with them. Each of the two groups then made up one rakah on their own.Ibn Umar said, "If the fear is greater than that, then pray while riding or standing, gesturing with movements."

Azami 2915

Sahih

عن ابن عمر قال

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

الأعظمي 2915صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Prayer of fear
Section
Prayer of fear while standing and riding
Numbering
Jami al-Kamil 2915 (2nd edition)
Azami 2915