Kaab bin Ujra reported,

We were with the Messenger of Allah ﷺ at Hudaybiyyah while we were in the state of ihram, and the polytheists had blocked our way. I had thick hair, and lice began falling onto my face. The Prophet ﷺ passed by me and asked, "Are the lice in your head troubling you?"I replied, "Yes."He said, and this verse was revealed, "Whoever among you is ill or has an ailment of the scalp must compensate by fasting, charity, or sacrifice" [Baqarah 2:196].

Bukhari 4191

Sahih

حدثني محمد بن هشام أبو عبد الله حدثنا هشيم عن أبي بشر عن مجاهد عن عبد الرحمن بن أبي ليلى

عن كعب بن عجرة قال

كنا مع رسول الله ﷺ بالحديبية ونحن محرمون وقد حصرنا المشركون قال وكانت لي وفرة فجعلت الهوام تساقط على وجهي فمر بي النبي ﷺ فقال أيؤذيك هوام رأسك قلت نعم قال وأنزلت هذه الآية {فمن كان منكم مريضا أو به أذى من رأسه ففدية من صيام أو صدقة أو نسك}

البخاري 4191صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Expeditions
Chapter
Expedition of Hudaybiya
Numbering
Darussalam 4191
Bukhari 4191