Sahih Muslim 843 b
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
وَحَدَّثَنَا عَبْدُ اللَّهِ بْنُ عَبْدِ الرَّحْمَنِ الدَّارِمِيُّ، أَخْبَرَنَا يَحْيَى، - يَعْنِي ابْنَ حَسَّانَ - حَدَّثَنَا مُعَاوِيَةُ، - وَهُوَ ابْنُ سَلاَّمٍ - أَخْبَرَنِي يَحْيَى، أَخْبَرَنِي أَبُو سَلَمَةَ بْنُ عَبْدِ الرَّحْمَنِ، أَنَّ جَابِرًا، أَخْبَرَهُ أَنَّهُ، صَلَّى مَعَ رَسُولِ اللَّهِ صلى الله عليه وسلم صَلاَةَ الْخَوْفِ فَصَلَّى رَسُولُ اللَّهِ صلى الله عليه وسلم بِإِحْدَى الطَّائِفَتَيْنِ رَكْعَتَيْنِ ثُمَّ صَلَّى بِالطَّائِفَةِ الأُخْرَى رَكْعَتَيْنِ فَصَلَّى رَسُولُ اللَّهِ صلى الله عليه وسلم أَرْبَعَ رَكَعَاتٍ وَصَلَّى بِكُلِّ طَائِفَةٍ رَكْعَتَيْنِ .
Abu Salama b. 'Abd al-Rahman reported that Jabir told him that he had observed the prayer in danger with the Messenger of Allah (ﷺ). The Messenger of Allah (ﷺ) (first) led one of the two groups in two rak'ah of prayer. and then led the second group in two rak'ah of prayer. So the Messenger of Allah (ﷺ) observed four rak'ah and led in two rak'ah each of the groups.
Full reference and source
Sahih Muslim 843 b In-book : Book 6, Hadith 378 USC-MSA web (English) : Book 4, Hadith 1831 (deprecated)
View source on Sunnah.com (opens in a new tab)