Sunan Ibn Majah, Book 5, Hadith 1207 (In-Book)

It was narrated from ‘Abdullah bin Sarjis that the Messenger of Allah saw a man performing the two Rak’ah before the morning prayer while he himself was performing prayer. When he had finished praying he said to him: “Which of your two prayers did you intend to be counted (i.e., accepted)?”

حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا أَبُو مُعَاوِيَةَ، عَنْ عَاصِمٍ، عَنْ عَبْدِ اللَّهِ بْنِ سَرْجِسَ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ رَأَى رَجُلاً يُصَلِّي الرَّكْعَتَيْنِ قَبْلَ صَلاَةِ الْغَدَاةِ وَهُوَ فِي الصَّلاَةِ فَلَمَّا صَلَّى قَالَ لَهُ ‏ "‏ بِأَىِّ صَلاَتَيْكَ اعْتَدَدْتَ ‏" ‏ ‏.‏

sunnah.com