Sunan An-Nasa'i - سنن النسائي
10. The Book of Leading the Prayer (Al-Imamah) - كتاب الإمامة
41) Chapter: Difference in the intention of the Imam and the one following him
837. It was narrated from Abu Bakr that the Prophet (ﷺ) offered the fear prayer (Salat Al-Khauf). He led those who were behind him in two Rak'ah and those who came (after them) in two Rak'ah, so the Prophet (ﷺ) prayed four Rak'ahs and each group prayed two.
41) باب اخْتِلاَفِ نِيَّةِ الإِمَامِ وَالْمَأْمُومِ
أَخْبَرَنَا عَمْرُو بْنُ عَلِيٍّ، قَالَ حَدَّثَنَا يَحْيَى، عَنْ أَشْعَثَ، عَنِ الْحَسَنِ، عَنْ أَبِي بَكْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم أَنَّهُ صَلَّى صَلاَةَ الْخَوْفِ فَصَلَّى بِالَّذِينَ خَلْفَهُ رَكْعَتَيْنِ وَبِالَّذِينَ جَاءُوا رَكْعَتَيْنِ فَكَانَتْ لِلنَّبِيِّ صلى الله عليه وسلم أَرْبَعًا وَلِهَؤُلاَءِ رَكْعَتَيْنِ رَكْعَتَيْنِ .