People are not in their senses while asleep. If a man utters “talaq” (divorce) while sleeping it will have no religious validity.

Sheikh `Abdul-Majeed Subh, a prominent Azhar scholar, states the following: Divorcing the wife while sleeping has no religious validity. So if a person utters the words of divorce while sleeping, such divorce cannot be considered valid if it is sure that he uttered “divorce” while sleeping. The Prophet (peace and blessings be upon him) is reported to have said, “The pen has been raised for three persons [meaning they are not held accountable for what they do]: one who is sleeping until he wakens, a child until he reaches the age of puberty, and an insane person until he becomes sane” (Ahmad, Abu Dawud, At-Tirmidhi, An-Nasa’i, Ibn Majah, and Al-Hakim).