The Messenger of Allah ﷺ said, "Three are given their reward twice. A man who had a slave girl whom he disciplined well and taught well, then freed her and married her. A slave who fulfills the right of Allah and the right of his masters. And a believer from among the People of the Book."
أخبرنا يعقوب بن إبراهيم قال حدثنا ابن أبي زائدة قال حدثني صالح بن صالح عن عامر عن أبي بردة بن أبي موسى
قال رسول الله ﷺ ثلاثة يؤتون أجرهم مرتين رجل كانت له أمة فأدبها فأحسن أدبها وعلمها فأحسن تعليمها ثم أعتقها وتزوجها وعبد يؤدي حق الله وحق مواليه ومؤمن أهل الكتاب
Bukhari narrated it in the Book of Knowledge, chapter "A man teaching his slave-girl and his family," hadith no. 97, and Muslim in the Book of Faith, chapter "The obligation of believing in the message of our Prophet Muhammad ﷺ to all people, and the abrogation of previous religious communities by his religious community," hadith no. 241/154, from the hadith of Salih with this wording, and it is found in Kubra, hadith no. 5502.Amir is Shaybi, and Ibn Abu Zaida is Yahya.