This question already has an answer here:
The Torah says וְאָהַבְתָּ לְרֵעֲךָ כָּמוֹךָ, Love your fellow as yourself.
Kitzur Shulchan Aruch: It is incumbent upon every Jew to love every fellow Jew as he loves himself.
Rambam: It is mandatory upon every man to love each and every one of Israel even as he loves his own self.
However, the Sefer Mitzvot Gadol says ודווקא לרעך שהוא רעך בתורה ובמצות אבל אדם רשע ואינו מקבל תוכחה מצוה לשנאותו, specifically your fellow (Jew) that he is your fellow in Torah and mitzvos. But if he is wicked and doesn't accept rebuke it is a mitzvah to hate him.
In addition, we also find the verse בְּצֶדֶק תִּשְׁפֹּט עֲמִיתֶךָ, judge your kinsman fairly, to which the Gemara derives עם שאתך בתורה ובמצות, With regard to one who is with you [im she’itekha] in observance of Torah and in fulfillment of mitzvot.
In halacha, which positive or negative commandments in the Torah would disqualify someone from being in the category of רעך בתורה ובמצות?