not include— (A) any distribution from a qualified cash or deferred arrangement (as defined in section 401(k)(2)), an annuity contract described in section 403(b), or an eligible deferred compensation plan described in section 457(b) which is maintained by an eligible employer described in section 457(e)(1)(A), which is treated as made upon hardship of the employee by reason of section 401(k)(14)(C), the last sentence of section 403(b)(11), or the last sentence of section 457(d)(1), or (B) any distribution from an individual retirement account (as defined in section 408(a)) to which section 72(t)(2)(E) applies. (2) Distributions must otherwise be includible (A) In general An amount shall be treated as described in paragraph (1) only to the extent that such amount would be includible in gross income without regard to such paragraph. (B) Application of section 72 In determining whether a distribution would be includible in gross income but for this subsection, rules similar to the rules of subsection (l)(3)(B) shall apply (by taking into account all retirement plans in which the taxpayer is a participant). . (b) Coordination with deductions and credits (1) Coordination with American Opportunity and Lifetime Learning credits (A) In general Paragraph (2) of section 25A(g) of the Internal Revenue Code of 1986 is amended by redesignating subparagraph (C) as subparagraph (D), by striking and at the end of subparagraph (B), and by inserting after subparagraph (B) the following new subparagraph: (C) a distribution from a qualified cash or deferred arrangement (as defined in section 401(k)(2)), an annuity contract described in section 403(b), an eligible deferred compensation plan described in section 457(b) which is maintained by an eligible employer described in section 457(e)(1)(A), or an individual retirement account (as defined in section 408(a)) which is excluded from gross income of the distributee under section 402(m) (other than any portion of such a distribution which is attributable to the repayment of a loan