Nafi reported,

Whenever Abdullah bin Umar رضي الله عنهم was asked about the prayer of fear, he would say, "The imam steps forward with a group of the people, and the imam leads them in one rakah, while another group remains positioned between them and the enemy without praying. When those with him have completed one rakah, they withdraw to take the place of those who have not yet prayed, but they do not give the salam. Then those who had not prayed step forward and pray one rakah with him. The imam then concludes, having prayed two rakahs. After the imam concludes, each member of the two groups stands and prays one rakah on his own, so that each individual from the two groups will have prayed two rakahs.If the fear is more intense than that, they pray as Some men, standing on their feet or mounted, whether facing the qiblah or not."Malik said, Nafi said, "I do not believe Abdullah bin Umar mentioned this except from the Messenger of Allah ﷺ."

Bukhari 4535

Sahih

حدثنا عبد الله بن يوسف حدثنا مالك

عن نافع

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

البخاري 4535صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tafsir
Chapter
His saying عز وجل, "If you fear, then on foot or riding; but when you are safe, remember Allah as He taught you what you did not know"
Numbering
Darussalam 4535
Bukhari 4535