Sunnah.com reference : Book 9, Hadith 1English translation : Book 9, Hadith 1199Arabic reference : Book 9, Hadith 1169
lbn Mas’ud (RAA) narrated that The Messenger of Allah (ﷺ) said:
“The blood of a Muslim who testifies that none has the right to be worshipped but Allah and that I am His Messenger, cannot be shed lawfully, except in three cases: a married person who committed adultery, in Qisas (retaliation) for murder (life for life) and the apostate from Islam who abandons the Muslim Jama’ah (community).” Agreed upon.
عَنْ اِبْنِ مَسْعُودٍ ‏- رضى الله عنه ‏- قَالَ: قَالَ رَسُولُ اَللَّهِ ‏- صلى الله عليه وسلم ‏-{ لَا يَحِلُّ دَمُ اِمْرِئٍ مُسْلِمٍ; يَشْهَدُ أَنْ لَا إِلَهَ إِلَّا اَللَّهُ, وَأَنِّي رَسُولُ اَللَّهِ, إِلَّا بِإِحْدَى ثَلَاثٍ: اَلثَّيِّبُ اَلزَّانِي, وَالنَّفْسُ بِالنَّفْسِ, وَالتَّارِكُ لِدِينِهِ; اَلْمُفَارِقُ لِلْجَمَاعَةِ }  مُتَّفَقٌ عَلَيْهِ  1‏ .‏‏1 ‏- صحيح.‏ رواه البخاري (6878)‏، ومسلم (1676)‏.‏