The Messenger of Allah ﷺ said, "By the One besides whom there is no god, the blood of a Muslim man who testifies that there is no god but Allah and that I am the Messenger of Allah is not lawful to shed except in three cases. The one who abandons Islam and separates from the community, the married person who commits adultery, and a life for a life."
قال رسول الله ﷺ: والذي لا إله غيره، لا يحل دم رجل مسلم يشهد أن لا إلا الله، وأني رسول الله، إلا ثلاثة نفر: التارك للإسلام المفارق للجماعة، والثيب الزاني، والنفس بالنفس.
Muslim narrated it in the chapter on Qasama (26:1676) from Ahmad bin Hanbal and Muhammad bin Muthanna, who said, Abdul-Rahman bin Mahdi told us, from Sufyan, from Amash, from Abdullah bin Mura, from Masruq, from Abdullah, and he mentioned it.Amash said, "I then related it to Ibrahim, and he related it to me from Aswad, from Ayesha, in the same manner."