(22) باب مَا يَفْعَلُ مَنْ سَلَّمَ مِنْ رَكْعَتَيْنِ نَاسِيًا وَتَكَلَّمَ
It was narrated from Abu Hurairah that :
The Messenger of Allah (ﷺ) finished praying two rak'ahs,and Dhul-Yadain said to him: "Has the prayer been shortened or did you forget, O Messenger of Allah?" The Messenger of Allah (ﷺ) said: "Is Dhul-Yadain speaking the truth?" The people said: "Yes." So the Messenger of Allah (ﷺ) stood up and prayed two, then he said the takbir and prostrated as usual or longer than that. Then he raised his head, then he prostrated as usual or longer than that, then he sat up."
Reference: Sunan an-Nasa'i 1225
In-book reference: Book 13, Hadith 47
English translation: Vol. 2, Book 13, Hadith 1226