Ordering rules
For purposes of applying this section and section 72 to any distribution from a Roth IRA, such distribution shall be treated as made—
(i)#
from contributions to the extent that the amount of such distribution, when added to all previous distributions from the Roth IRA, does not exceed the aggregate contributions to the Roth IRA; and
(ii)#
from such contributions in the following order:
(I) Contributions other than qualified rollover contributions to which paragraph (3) applies.
(II) Qualified rollover contributions to which paragraph (3) applies on a first-in, first-out basis.
(ii)(I)#
Contributions other than qualified rollover contributions to which paragraph (3) applies.
(ii)(II)#
Qualified rollover contributions to which paragraph (3) applies on a first-in, first-out basis.
Any distribution allocated to a qualified rollover contribution under clause (ii)(II) shall be allocated first to the portion of such contribution required to be included in gross income.