Mishkat al-Masabih
Mishkat al-Masabih 1156
وَعَنِ ابْنِ عُمَرَ رَضِيَ اللَّهُ عَنْهُمَا: أَنَّ رَجُلًا سَأَلَهُ فَقَالَ: إِنِّي أُصَلِّي فِي بَيْتِي ثُمَّ أُدْرِكُ الصَّلَاةَ فِي الْمَسْجِدِ مَعَ الْإِمَامِ أَفَأُصَلِّي مَعَهُ؟ قَالَ لَهُ: نَعَمْ قَالَ الرجل: أَيَّتهمَا أجعَل صَلَاتي؟ قَالَ عُمَرَ: وَذَلِكَ إِلَيْكَ؟ إِنَّمَا ذَلِكَ إِلَى اللَّهِ عَزَّ وَجَلَّ يَجْعَلُ أَيَّتَهُمَا شَاءَ. رَوَاهُ مَالِكٌ
Unreviewed translation. All hadiths in this collection are available in five languages. Titles and introductions may remain in Arabic.
Ibn Umar, may God be pleased with them both, said that a man asked him: I pray at home, then catch the prayer in the mosque with the imam. Should I pray with him? He said: Yes. The man asked: Which of the two should I count as my prescribed prayer? Ibn Umar said: Is that up to you? It is for God, Mighty and Majestic, to make whichever of them He wills. Malik transmitted it.