'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.
This hadith has been narrated on the authority of A'mash.
'Abdullah (b. Mas'ud) reported
Allah's Messenger (ﷺ) stood up and said: By Him besides Whom there is no god but He, the blood of a Muslim who bears the testimony that there is no god but Allah, and I am His Messenger, may be lawfully shed only in case of three persons: the one who abandons Islam, and deserts the community [Ahmad, one of the narrators, is doubtful whether the Prophet (ﷺ) used the word li'l-jama'ah or al-jama'ah), and the married adulterer, and life for life.
This hadith has been reported on the authority of A'mash with the same chain of narrators but with a slight variation of words, i. e. he did not say
By Him besides Whom there is no god.