Language:
كتاب الأذان
10  
Call to Prayers (Adhaan)
(69)
Chapter: Can the Imam depend on the people's saying if he is in doubt (about a certain matter)?
(69)
باب هَلْ يَأْخُذُ الإِمَامُ إِذَا شَكَّ بِقَوْلِ النَّاسِ
Sahih al-Bukhari 715

Narrated Abu Huraira:

The Prophet (ﷺ) prayed two rak`at of Zuhr prayer (instead of four) and he was told that he had prayed two rak`at only. Then he prayed two more rak`at and finished them with the Taslim followed by two prostrations.

حَدَّثَنَا أَبُو الْوَلِيدِ، قَالَ حَدَّثَنَا شُعْبَةُ، عَنْ سَعْدِ بْنِ إِبْرَاهِيمَ، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ، قَالَ صَلَّى النَّبِيُّ صلى الله عليه وسلم الظُّهْرَ رَكْعَتَيْنِ، فَقِيلَ صَلَّيْتَ رَكْعَتَيْنِ‏.‏ فَصَلَّى رَكْعَتَيْنِ، ثُمَّ سَلَّمَ ثُمَّ سَجَدَ سَجْدَتَيْنِ‏.‏
Reference : Sahih al-Bukhari 715
In-book reference : Book 10, Hadith 110
USC-MSA web (English) reference : Vol. 1, Book 11, Hadith 683
  (deprecated numbering scheme)