(22) باب مَا يَفْعَلُ مَنْ سَلَّمَ مِنْ رَكْعَتَيْنِ نَاسِيًا وَتَكَلَّمَ
It was narrated from Abu Hurairah that:
The Messenger of Allah (ﷺ) prayed one day and said the salam after two rak'ahs, then he left. Dhul-Shimalain caught up with him and said: "O Messenger of Alah, has the prayer been shortened or did you forget?" He said: "The prayer has not been shortened, and I did not forget." He said: "Yes, by the One Who sent you with the truth." The Messenger of Allah (ﷺ) said: 'Is Dhul-Yadain speaking the truth?" They said: 'Yes.' So he led the people in praying two rak'ahs.
Reference: Sunan an-Nasa'i 1228
In-book reference: Book 13, Hadith 50
English translation: Vol. 2, Book 13, Hadith 1229