that the Messenger of Allah (ﷺ) said: "The blood of a Muslim man, who testifies that none has the right to be worshipped Allah, is not lawful except for one of three cases: The (previously married or) married adulterer, a life for a life, and the one who leaves the religion and parts from the Jama'ah (the community of Muslims.)
Jami` at-Tirmidhi Book 16, Hadith 18