Ya'qub bin Afif (may Allah have mercy on him) asked Sayyiduna Abu Ayyub (may Allah be pleased with him), the Companion of the Messenger of Allah (peace and blessings be upon him), about a man who has already prayed in his house, then comes to the mosque and finds that same prayer being held in congregation: should he repeat it with the people or not? (He said:) We asked the Messenger of Allah (peace and blessings be upon him) about this, and he (peace and blessings be upon him) said: "Yes, he should repeat it; he will receive a share of the congregation."
A man from the tribe of Asad Khuzaymah narrated that he asked Abu Ayyub al-Ansari (may Allah be pleased with him): I pray in my house, then I come to the mosque and the prayer is established, so I pray it again with them, but I feel some unease in my heart about it. Abu Ayyub (may Allah be pleased with him) said: We asked the Prophet (peace and blessings be upon him) about this, and he (peace and blessings be upon him) said: "For that he will receive a share of the congregation." (Imam Malik did not narrate it as marfu'.)
Hadith Referenceالمعجم الكبير للطبراني / باب الخاء / 3983