(Imām Bukhārī narrates): Musaddad narrated the hadith to us, he said: Yahya narrated the hadith to us, from Ubaidullah, he said: Nafi' narrated the hadith to me, from Hazrat Ibn Umar (Allāh be pleased with them both), he narrates that
the Prophet ﷺ used to come to Masjid Quba riding and on foot.
Ibn Numair added this: Ubaidullah narrated the hadith to us, from Nafi', so he would offer two rak'ahs of prayer.
حَدَّثَنَا مُسَدَّدٌ حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ عَنْ عُبَيْدِ اللَّهِ قَالَ حَدَّثَنِي نَافِعٌ عَنْ ابْنِ عُمَرَ رَضِيَ اللَّهُ عَنْهُمَا قَالَ كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَأْتِي مَسْجِدَ قُبَاءٍ رَاكِبا وَمَاشِيًا زَادَ ابْنُ نُمَيْرٍ حَدَّثَنَا عُبَيْدُ اللَّهِ عَنْ نَافِعٍ فَيُصَلِّي فِيهِ رَكْعَتَينِ
Reference: Sahih Al Bukhari 1194