; (ii) is a recipient of a Federal Pell Grant under subpart 1 of part A of title IV of this Act; (iii) is maintaining satisfactory progress (as defined in section 484(c)) in the student’s course of study; (iv) is enrolled in an eligible program (as defined in section 481(b)); and (v) either— (I) qualifies for in-State resident institution of higher education tuition, as determined by the State or Indian tribe; or (II) would qualify for such in-State tuition, but for the immigration status of such student. (B) Special rule An otherwise Pell Grant recipient shall lose eligibility under this section— (i) after 3 years of receiving benefits under this section for enrollment at a community college (as defined in section 499F); and (ii) after 6 years of receiving benefits under this section for enrollment in a 4-year institution of higher education. (4) Recognized postsecondary credential The term recognized postsecondary credential has the meaning as described in section 3 of the Workforce Innovation and Opportunity Act ( 29 U.S.C. 3102 ). (5) State The term State has the meaning given the term in section 103. (6) Unmet need The term unmet need means, with respect to a Pell Grant recipient, the amount determined by calculating the difference between— (A) the institution's cost of attendance (as defined in section 472) for the year for which the determination is made; and (B) the sum of— (i) the total amount of need-based grant aid and merit-based grant aid, from Federal, State, and institutional sources, provided to such Pell Grant recipient for the year for which the determination is made