Mishkat al-Masabih 1156
وَعَنِ ابْنِ عُمَرَ رَضِيَ اللَّهُ عَنْهُمَا: أَنَّ رَجُلًا سَأَلَهُ فَقَالَ: إِنِّي أُصَلِّي فِي بَيْتِي ثُمَّ أُدْرِكُ الصَّلَاةَ فِي الْمَسْجِدِ مَعَ الْإِمَامِ أَفَأُصَلِّي مَعَهُ؟ قَالَ لَهُ: نَعَمْ قَالَ الرجل: أَيَّتهمَا أجعَل صَلَاتي؟ قَالَ عُمَرَ: وَذَلِكَ إِلَيْكَ؟ إِنَّمَا ذَلِكَ إِلَى اللَّهِ عَزَّ وَجَلَّ يَجْعَلُ أَيَّتَهُمَا شَاءَ. رَوَاهُ مَالِكٌ
From Ibn ʿUmar, may Allah be pleased with them both: A man asked him, saying: "I pray in my house, then I catch the prayer in the mosque with the imam. Should I pray with him?" He said to him: "Yes." The man said: "Which of them should I make my prayer?" [Ibn] ʿUmar said: "Is that up to you? That is only up to Allah, Mighty and Majestic; He makes whichever of them He wills [count]." Reported by Malik.