Sunan Abi Dawud, Hadith 4338 ⓘ
`Abd Allah (b. Mas`ud) reported the Messenger of Allah (peace be upon him) as saying: The blood of a Muslim man who testifies that there is no god but Allah and that I am the Messenger of Allah should not be lawfully shed but only for one of three reasons: married fornicator, soul for soul, and one who deserts his religion separating himself from the community.
حَدَّثَنَا عَمْرُو بْنُ عَوْنٍ، أَخْبَرَنَا أَبُو مُعَاوِيَةَ، عَنِ الأَعْمَشِ، عَنْ عَبْدِ اللَّهِ بْنِ مُرَّةَ، عَنْ مَسْرُوقٍ، عَنْ عَبْدِ اللَّهِ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " لاَ يَحِلُّ دَمُ رَجُلٍ مُسْلِمٍ يَشْهَدُ أَنْ لاَ إِلَهَ إِلاَّ اللَّهُ وَأَنِّي رَسُولُ اللَّهِ إِلاَّ بِإِحْدَى ثَلاَثٍ الثَّيِّبُ الزَّانِي وَالنَّفْسُ بِالنَّفْسِ وَالتَّارِكُ لِدِينِهِ الْمُفَارِقُ لِلْجَمَاعَةِ " .
also referenced under: Hadith 4352 (DarusSalam)