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 your question that shows your interest to learn more about Islam.
As for your question, in spite of committing sins, a Muslim is still a Muslim as long as he/she has not considered these sins, especially major ones (kaba’r), as lawful.
In his response to your question, Sheikh Ahmad Kutty, a senior lecturer and an Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
You have it wrong; what the Prophet meant is that those who indulge in such sins are like the people of Lot (peace and blessings be upon him).
Homosexuality is indeed a grave sin. However, like everyone who is guilty of a grave sin such as adultery, murder, etc., he or she still remains a Muslim, albeit a sinful one.
They remain Muslims, as long as they do not consider such grave deeds as lawful. There is a difference between someone who is committing a sin and someone who considers it as lawful. To declare that which Allah has clearly forbidden as lawful would result in a person’s expulsion from the fold of Islam.
In conclusion, those who are guilty of sins such as homosexuality, adultery, etc. are still considered as Muslims.
Allah Almighty knows best.