; and (B) is enrolled or accepted for enrollment in a postbaccalaureate program that does not lead to a graduate degree, and in courses required by a State in order for the student to receive a professional certification or licensing credential that is required for employment as a teacher in an elementary school or secondary school in that State, except that this paragraph shall not apply to a student who is enrolled in an institution of higher education that offers a baccalaureate degree in education. (5) Maximum period (A) In General Except as provided in subparagraph (B), the period during which a student may receive Federal Pell Grants shall not exceed 12 semesters, or the equivalent of 12 semesters, as determined by the Secretary by regulation. Such regulations shall provide, with respect to a student who received a Federal Pell Grant for a term but was enrolled at a fraction of full time, that only that same fraction of such semester or equivalent shall count towards such duration limits. (B) Exception (i) In general Any Federal Pell Grant that a student received during a period described in subclause (I) or (II) of clause (ii) shall not count towards the student’s duration limits under this paragraph. (ii) Applicable periods Clause (i) shall apply with respect to any Federal Pell Grant awarded to a student to enroll in an eligible program at an institution— (I) during a period of a student’s attendance at an institution— (aa) at which the student was unable to complete a course of study due to the closing of the institution; or (bb) for which the student was falsely certified as eligible for Federal aid under this title; or (II) during a period— (aa) for which the student received a loan under this title; and (bb) for which the loan described in item (aa) is discharged under— (AA) section 437(c)(1) or section 464(g)(1)