We have seen that the desecration of Shabbat is exceedingly grave; one who publicly desecrates Shabbat, like the idolater, is viewed as having disaffiliated from the Jewish people and is treated as a non-Jew. As Rambam writes:
Both Shabbat and idolatry are the equivalent of all the remaining mitzvot of the Torah. Shabbat is the eternal sign between God and us. Thus, one who transgresses other mitzvot is grouped with wicked Jews, but one who publicly desecrates Shabbat is like an idolater; both are like non-Jews in all matters. (MT 30:15) 
In other words, in general one who violates one of the Torah’s many prohibitions is not considered an apostate; he is treated as a Jew who sinned. But those who worship idols or publicly desecrate Shabbat, even if they are not motivated by spite (“lehakhis”), and even if they observe all the other mitzvot, are subject to rabbinic sanction. As long as they have not repented, they are viewed as having completely apostatized, and halakha treats them as non-Jews for all purposes (Eruvin 69b; m. Ĥullin 5:1). This means that their offerings are not accepted in the Temple (MT, Laws of Sacrificial Procedure 3:4), they do not count for a minyan (prayer quorum) (MB 55:46), and wine that they touched may not be drunk. There is no mitzva to treat them with the kindness due to every Jew (Ahavat Ĥesed I 3:3).
However, in modern times, a number of halakhic authorities have ruled that as long as a Shabbat desecrator is not acting defiantly, he should not be treated as an idolater. In the past, when all Jews kept Shabbat, one who publicly desecrated it (even if not spitefully) was considered disaffiliated from the Jewish people. But in recent times when, much to our chagrin, many Jews do not keep Shabbat, only one who publicly desecrates Shabbat out of spite or to harm Israel’s Torah is considered like an idolater. In contrast, one who desecrates Shabbat for his own convenience is not equated with one who decides to alienate himself from his Jewish heritage (Melamed Le-ho’il, OĤ 29; Binyan Tziyon Ha-ĥadashot §23; see Peninei Halakha: Prayer 2:8). Therefore, in practice, if such a person wishes to join a minyan, he may be counted, and it is a mitzva to be as kind to him as to any other Jew. Nevertheless, even today there are many authorities who maintain that a public Shabbat desecrator should be treated as a non-Jew. Therefore, even one who finds it difficult to observe Shabbat because of his education and habits should at a minimum try to light Shabbat candles before sundown Friday, make kiddush, and observe whatever he can. He thus demonstrates that Shabbat is important to him, and that he wishes to connect with his heritage. In such a case, even according to those who rule stringently he would not be considered an idolater.
It must be noted that in any case a Jew cannot completely disconnect from Judaism. Even if he worships idols, intentionally desecrates Shabbat, and commits every sin in the Torah, he remains a Jew, and his soul possesses the sanctity of a Jew. Yet he is exceedingly wicked, and his punishment is greater than that of other sinners, who did not disaffiliate from the Jewish people (Zohar II 151:2). This is why the Sages established that, on the one hand, we distance ourselves from serious sinners, while on the other hand, when possible, we try to encourage their repentance.