Sunan an-Nasa'i, Book 13, Hadith 70 (Nasa'i 1250)

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'".