The Messenger of Allah ﷺ said, "Three people will have a double reward. A man from the People of the Book who believed in his prophet and then believed in Muhammad ﷺ. A slave who fulfills the rights of Allah and the rights of his masters. And a man who has a slave-girl, whom he disciplines well, teaches well, then frees her and marries her. He will have two rewards."
قال رسول الله ﷺ: ثلاثة لهم أجران، رجل من أهل الكتاب آمن بنبيه، وآمن بمحمد ﷺ، والعبد المملوك إذا أدى حق الله وحق مواليه، ورجل كانت عنده أمة، فأدبها فأحسن تأديبها، وعلمها فأحسن تعليمها، ثم أعتقها فتزوجها له أجران.
Bukhari narrated it in the Book of Knowledge (97), and Muslim in the Book of Faith (154), both from the hadith of Salih bin Hayan. Amir Shaybi said, "Abu Burda narrated to me, from his father (Abu Musa)," and he related it. This is how it appears in full according to Bukhari.According to Muslim, from Salih bin Salih Hamdani, from Shaybi, who said, "I saw a man from the people of Khurasan ask Shaybi, and he said, 'O Abu Amr, those among us from the people of Khurasan say about a man, if he frees his slave woman and then marries her, he is like one who rides his sacrificial camel.' Shaybi said, 'Abu Burda bin Abu Musa narrated to me, from his father, that the Messenger of Allah ﷺ said,' and he related the hadith in the same manner. Then Shaybi said to the man from Khurasan, 'Take this hadith without paying anything for it, for a man used to travel for less than this all the way to Madinah.'"