Wa `alaykum as-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Dear brother, thank you for trusting us and for your question that shows how Allah-fearing and truthful penitent you are. May Allah accept your repentance and forgive your sin!
Brother, really, one of the most tragic and consequential sins in which a man engages is homosexuality. This heinous crime destroys characters and destroys within some people the hope of attaining Allah’s pleasure.
But in Islam, the door of repentance is always open, only that the repentance itself demands a resolve to cease from a sinful activity. A person who has engaged himself in such a sin must resolve to cease from the sinful sexual activity and return to Allah, seeking His forgiveness. Allah will surely turn unto him and shower him with His mercy.
This indicates, brother, that you should never lose hope in gaining Allah’s mercy. As you have indeed committed a major sin, you should repent very seriously and immediately. Rush to Allah and beseech Him to forgive you.
So, call Allah Almighty and He will surely hear you, respond to you, and expiate all your sins as long as you are sincere in your feelings.
Allah says in the Qur’an,
“Say: ‘O my Servants who have transgressed against their souls! Despair not of the Mercy of Allah: for Allah forgives all sins: for He is Oft-Forgiving, Most Merciful.’” (Az-Zumar 39:53)
“Allah accepts the repentance of those who do evil in ignorance and repent soon afterwards; to them will Allah turn in mercy: For Allah is full of knowledge and wisdom.” (An-Nisaa’ 4:17)
Moreover, the Glorious Qur’an gives glad tidings to penitent people who having committed sins such as zina (adultery) or homosexuality regretted their sins, determined not to do them once again, and performed righteous deeds that Allah will replace their sins with hasanat (rewards). Allah says,
“(And true servants of Allah are) those who cry not unto any other god along with Allah, nor take the life which Allah has forbidden save in (course of) justice, nor commit adultery and who does this shall pay the penalty; the doom will be doubled for him on the Day of Resurrection, and he will abide therein disdained forever; save him who repents and believes and does righteous work; as for such, Allah will change their evil deeds to good deeds. Allah is ever Forgiving, Merciful. And, whosoever repents and does good, he verily repents toward Allah with true repentance.” (Al-Furqan 25:68-71)
So, dear brother, as a sign and proof of your true repentance, you should be keen on performing your prayers regularly, and always get yourself more involved in Islamic work. You should focus on going to the masjid (mosque), reciting the Qur’an on a daily basis, and attending Islamic classes, and try to be away from any company that does not remind you of Allah.
Moreover, give sadaqah (charity) to the poor and the needy with the intention to purify yourself and expiate your sins.
May Allah Almighty accept your repentance and guide you, and all Muslims, to the Right Path.
Allah Almighty knows best.