Sahih Muslim 1676 a
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
لاَ يَحِلُّ دَمُ امْرِئٍ مُسْلِمٍ يَشْهَدُ أَنْ لاَ إِلَهَ إِلاَّ اللَّهُ وَأَنِّي رَسُولُ اللَّهِ إِلاَّ بِإِحْدَى ثَلاَثٍ الثَّيِّبُ الزَّانِ وَالنَّفْسُ بِالنَّفْسِ وَالتَّارِكُ لِدِينِهِ الْمُفَارِقُ لِلْجَمَاعَةِ "
Abdullah (b. Mas'ud) reported Allah's Messenger (ﷺ) as saying:
It is not permissible to take the life of a Muslim who bears testimony (to the fact that there is no god but Allah, and I am the Messenger of Allah, but in one of the three cases: the married adulterer, a life for life, and the deserter of his Din (Islam), abandoning the community.
Full reference and source
Sahih Muslim 1676 a In-book : Book 28, Hadith 34 USC-MSA web (English) : Book 16, Hadith 4152 (deprecated)
View source on Sunnah.com (opens in a new tab)