Praise be to Allah.
One of the things concerning which there can be no doubt is the fact that committing acts of disobedience and major sins openly is sin upon sin which may lead a person to kufr at the time of committing that sin openly, because he takes the prohibition on that lightly and is proud of what he is doing. There is no difference between major and minor sins with regard to this ruling.
It was narrated that Abu Hurayrah said: I heard the Messenger of Allaah (peace and blessings of Allaah be upon him) say: “All of my ummah may be forgiven except those who commit sin openly. It is a kind of committing sin openly if a man does something at night, then morning comes and Allaah has concealed his sin, but he says, ‘O So and so, I did such and such last night,’ when his Lord has concealed him (his action) all night but in the morning he reveals that which Allaah had concealed for him.”
Narrated by al-Bukhaari, 5721; Muslim, 2990
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) said:
… There is a third type of immoral, prmiscuous evildoer, who speaks of zina with pride (Allaah forbid), and speaks of how he traveled to such and such a land, and committed immoral actions and adultery with a number of women, and so on, and he boasts about that.
This person should be asked to repent; if he repents all well and good, otherwise he should be executed, because if a person boasts about committing zina, this implies that he regards zina as being permissible (Allaah forbid), and whoever regards zina as permissible is a kaafir.
Sharh Riyaadh al-Saaliheen, 1/116
Undoubtedly there are varying degrees of disobedience, and the level of sin varies according to the person’s state of mind whilst committing the sin and afterwards. The one who conceals his sin is not like one who commits sin openly. The one who regrets it afterwards is not like one who boasts about it.
Ibn al-Qayyim said:
In conclusion, evil actions vary according to their consequences. Those who have boyfriends or girlfriends commit a less serious sin than those who commit immoral actions with anyone; the one who commits sin in secret is doing something less serious than one who commits sin openly and broadcasts it. The one who keeps quiet about it commits a less serious sin than one who tells people about it. Such a one is far removed from the forgiveness of Allaah, as the Prophet (peace and blessings of Allaah be upon him) said: “All of my ummah may be forgiven except those who commit sin openly…”
Ighaathat al-Lahfaan, 2/147
The basic principle is that the Muslim should follow his sin with repentance and seeking forgiveness; he should regret what he has done and resolve never to go back to it. He should not follow it with boasting and speaking openly about it.
Ahmad (8792) and al-Tirmidhi (3334) narrated that Abu Hurayrah (may Allaah be pleased with him) said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “If the believer commits a sin, a black spot appears on his heart. If he repents, gives it up and seeks forgiveness, his heart is cleansed, but if he does more then (that spot) increases until it covers his heart. That is the raan (covering of sin) which Allaah mentioned in the Qur’aan:
“Nay! But on their hearts is the Raan (covering of sins and evil deeds) which they used to earn”"
Classed as hasan by al-Albaani in Saheeh al-Tirmidhi, 2654
There remains one issue that was mentioned in the question, which is the committing of sin openly by those who are new in Islam. Those people are still unaware of the rulings of Islam, so they are excused if they do not know the shar’i rulings, but they should be taught. So strive to teach them, and show them this answer.
May Allaah help us to do that which He loves and which pleases Him.
And Allaah knows best.