Sayyiduna Ibn Mas’ud (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) said: “The blood of a Muslim who testifies that there is no deity except Allah and that I am the Messenger of Allah is not lawful, except in one of three cases: if he commits adultery while being married, or if he kills someone and retribution is required, or if he abandons his religion and separates from the community.”
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 3621