مختصر صحيح مسلم
Mukhtasar Sahih Muslim
On Faith
If a person’s Islam is good, he is not accountable for pre-Islamic deeds.
Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with them) reports that the people said to the Messenger of Allah (peace and blessings be upon him): "O Messenger of Allah! Will we be questioned about the deeds we did during the time of ignorance (Jahiliyyah)?" The Prophet (peace and blessings be upon him) replied: "Whoever among you embraced Islam well (that is, became a true Muslim from the heart), he will not be held accountable for the deeds of Jahiliyyah. But whoever is evil (that is, only became a Muslim outwardly while disbelief remained in his heart), he will be held accountable for both the deeds of Jahiliyyah and of Islam."