Narrated Ali ibn Abu Talib: Abu Zubyan said: A woman who had committed adultery was brought to Umar. He gave orders that she should be stoned. Ali passed by just then. He seized her and let her go. Umar was informed of it. He said: Ask Ali to come to me. Ali came to him and said: Commander of the Faithful, you know that the Messenger of Allah ﷺ said: There are three (people) whose actions are not recorded: A boy till he reaches puberty, a sleeper till he awakes, a lunatic till he is restored to reason. This is an idiot (mad) woman belonging to the family of so and so. Someone might have done this action with her when she suffered the fit of lunacy. Umar said: I do not know. Ali said: I do not know.
Hadith Referenceسنن ابي داود / كتاب الحدود / 4402
Hadith Gradingالألبانی:صحيح دون قوله لعل الذي | زبیر علی زئی:ضعيف, إسناده ضعيف, عطاء بن السائب اختلط, انوار الصحيفه، صفحه نمبر 156
Hadith Takhrij« تفرد بہ أبو داود، (تحفة الأشراف: 10196، 10078) (صحیح) » دون قولہ : «لعل الذی» سے آخر تک ثابت نہیں ہے
Narrated Ali ibn Abu Talib: The Prophet ﷺ said: There are three (persons) whose actions are not recorded: a sleeper till he awakes, a boy till he reaches puberty, and a lunatic till he comes to reason. Abu Dawud said: Ibn Juraij has transmitted it from Al-Qasim bin Yazid on the authority of Ali from the Prophet ﷺ. This version adds: "and an old man who is feeble-minded. "
Shaykh Umar Farooq Saeedi
Benefits and Issues: An elderly person who has lost his senses and is not in possession of his intellect and awareness, the same ruling applies to him as well. And Allah knows best.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 4403