Ibn Abi al-Kharif reports, through his father, this statement of his grandfather: My brother and I came to the Prophet (peace and blessings be upon him) while he was in Masjid al-Khayf. We had already offered the obligatory prayer at home, so we did not pray with the people. The Prophet (peace and blessings be upon him) asked: "Why did the two of you not pray with us?" We said: "We had already offered the obligatory prayer at home." The Prophet (peace and blessings be upon him) said: "When a man has offered the obligatory prayer at home and then finds a congregation, he should pray with them as well; the prayer he offered at home will be counted as voluntary (nafl)."
Imam al-Tabarani recorded this narration in al-Mu'jam al-Kabir. As for Ibn Abi al-Kharif and his father, I do not know who they are.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 2174