; and (2) will be occupied by the qualified homebuyer, in accordance with such assurances and commitments as the Secretary shall require, as the primary residence of the homebuyer, subject to section 3. (b) Repayment of assistance (1) Requirement The Secretary shall require that, if a homebuyer to or on behalf of whom assistance is provided from grant amounts under this Act fails or ceases to occupy the property acquired using such assistance as the primary residence of the homebuyer, except in the case of assistance provided in connection with the purchase of a principal residence through a shared equity homeownership program, the homebuyer shall repay to the State or eligible entity, as applicable, in a proportional amount of the assistance the homebuyer receives based on the number of years they have occupied the eligible home up to 5 years, except that no assistance shall be repaid if the qualified homebuyer occupies the eligible home as a primary residence for 5 years or more. (2) Limitation Notwithstanding subparagraph (A), a homebuyer to or on behalf of whom assistance is provided from grant amounts under this Act shall not be liable to the State or eligible entity for the repayment of the amount of such shortage if the homebuyer fails or ceases to occupy the property acquired using such assistance as the principal residence of the homebuyer at least in part because of a hardship, or sells the property acquired with such assistance before the expiration of the 60-month period beginning on such date of acquisition and the capital gains from such sale to a bona fide purchaser in an arm’s length transaction are less than the amount the homebuyer is required to repay the State or eligible entity under subparagraph (A). 5. Eligible mortgage loans Assistance from grant amounts under this Act may be provided only in connection with the acquisition of an eligible home involving a residential mortgage loan that— (1) meets the underwriting requirements and dollar amount limitations for acquisition by the Federal