Sunan An-Nasa'i - سنن النسائي
13. The Book of Forgetfulness (In Prayer) - كتاب السهو
25) Chapter: Estimating (what is most likely the case)
It was narrated that Abdullah bin Ja'far said:
"The Messenger of Allah (ﷺ) said: 'Whoever has doubt during his prayer, let him prostrate twice after he has said the taslim'".
25) باب التَّحَرِّي
أَخْبَرَنَا سُوَيْدُ بْنُ نَصْرٍ، قَالَ أَنْبَأَنَا عَبْدُ اللَّهِ، عَنِ ابْنِ جُرَيْجٍ، قَالَ قَالَ عَبْدُ اللَّهِ بْنُ مُسَافِعٍ عَنْ عُتْبَةَ بْنِ مُحَمَّدِ بْنِ الْحَارِثِ، عَنْ عَبْدِ اللَّهِ بْنِ جَعْفَرٍ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم . " مَنْ شَكَّ فِي صَلاَتِهِ فَلْيَسْجُدْ سَجْدَتَيْنِ بَعْدَ مَا يُسَلِّمُ "