All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Allaah, the Exalted accepts the repentance of the disbeliever (who embraces Islam) and pardons all his sins, even Shirk (polytheism), by His grace and mercy. This is to encourage disbelievers to embrace Islam, for if they knew that their past sins will not be forgiven after conversion, then they might not embrace Islam in the first place. Allaah, the Exalted, says (what means): {Say to those who have disbelieved [that] if they cease, what has previously occurred will be forgiven for them. But if they return [to hostility]—then the precedent of the former [rebellious] peoples has already taken place.} [Quran 8:38] The Prophet, sallallaahu ‘alayhi wa sallam, said: "Islam wipes out all one's past sins." [Ahmad; Al-Arnaa’oot: good]
This pardon includes all sins and wrongdoings, whether they are related to the Rights of Allaah, the Exalted, over the person or other people's rights. Ibn Al-‘Arabi said, "This is the correct opinion due to the general indication of the verse's wording. Allaah, the Exalted, says (what means): {... if they cease, what has previously occurred will be forgiven for them...} [Quran 8:38]"
Some scholars believed that when the disbeliever embraces Islam, all his past sins are forgiven, except for what is related to other people's rights, and (they also believed) that he should be held accountable for any aggression and violations that he committed against other people. Ibn ‘Abideen said:
"Since the disbeliever's drinking of wine does not entail the application of hadd (corporal punishment prescribed by the Sharee'ah) for drinking—meaning before his conversion to Islam—then he should not be subjected to punishment after embracing Islam. However, if he commits adultery or steals and then embraces Islam, then the hadd should be implemented in this case, because the hadd is applicable on him even at the time of his disbelief." [Radd Al-Muhtar]
Allaah Knows best.