Lazima is a past-tense verb from l-z-m, 'to become binding.' The suffix -hu is the object referring to the pilgrim. Damun is the nominative subject: the sacrifice became due.
In ʿinda Abī Ḥanīfah, ʿinda is an adverbial/idafah head, Abī is its genitive complement (one of the five nouns, marked with yāʾ), and Ḥanīfah is the next idafah complement. The phrase means according to Abu Hanifah.