He set out with the Prophet ﷺ in a state of ihram, and his head and beard became infested with lice. Word of this reached the Prophet ﷺ, who sent for him and called the barber, who shaved his head.Then the Prophet ﷺ asked him, "Do you have an animal for sacrifice?"He replied, "I cannot afford one."So the Prophet ﷺ ordered him to fast three days, or to feed six poor people, giving every two of them one saa. Allah then revealed concerning him specifically, "And whoever among you is ill or has an ailment of the head" [Baqarah 2:196], and the ruling later applied to all Muslims generally.
و حدثنا أبو بكر بن أبي شيبة حدثنا عبد الله بن نمير عن زكرياء بن أبي زائدة حدثنا عبد الرحمن بن الأصبهاني حدثني عبد الله بن معقل حدثني
أنه خرج مع النبي ﷺ محرما فقمل رأسه ولحيته فبلغ ذلك النبي ﷺ فأرسل إليه فدعا الحلاق فحلق رأسه ثم قال له هل عندك نسك قال ما أقدر عليه فأمره أن يصوم ثلاثة أيام أو يطعم ستة مساكين لكل مسكينين صاع فأنزل الله عز وجل فيه خاصة {فمن كان منكم مريضا أو به أذى من رأسه} ثم كانت للمسلمين عامة