The amount of an individual’s excess earnings (as defined in paragraph (3)) shall be charged to months as follows: There shall be charged to the first month of such taxable year an amount of his excess earnings equal to the sum of the payments to which he and all other persons (excluding divorced spouses referred to in subsection (b)(2)) are entitled for such month under
section 402 of this title on the basis of his wages and self-employment income (or the total of his excess earnings if such excess earnings are less than such sum), and the balance, if any, of such excess earnings shall be charged to each succeeding month in such year to the extent, in the case of each such month, of the sum of the payments to which such individual and all such other persons are entitled for such month under
section 402 of this title on the basis of his wages and self-employment income, until the total of such excess has been so charged. Where an individual is entitled to benefits under
section 402(a) of this title and other persons (excluding divorced spouses referred to in subsection (b)(2)) are entitled to benefits under section 402(b), (c), or (d) of this title on the basis of the wages and self-employment income of such individual, the excess earnings of such individual for any taxable year shall be charged in accordance with the provisions of this subsection before the excess earnings of such persons for a taxable year are charged to months in such individual’s taxable year. Notwithstanding the preceding provisions of this paragraph but subject to
section 402(s) of this title, no part of the excess earnings of an individual shall be charged to any month (A) for which such individual was not entitled to a benefit under this subchapter, (B) in which such individual was at or above retirement age (as defined in section 416(
l) of this title), (C) in which such individual, if a child entitled to child’s insurance benefits, has attained the age of 18, (D) for which such individual is entitled to widow’s or widower’s insurance benefits if such individual became so entitled prior to attaining age 60, (E) in which such individual did not engage in self-employment and did not render services for wages (determined as provided in paragraph (5) of this subsection) of more than the applicable exempt amount as determined under paragraph (8), if such month is in the taxable year in which occurs the first month after December 1977 that is both (i) a month for which the individual is entitled to benefits under subsection (a), (b), (c), (d), (e), (f), (g), or (h) of
section 402 of this title (without having been entitled for the preceding month to a benefit under any other of such subsections), and (ii) a month in which the individual did not engage in self-employment and did not render services for wages (determined as provided in paragraph (5)) of more than the applicable exempt amount as determined under paragraph (8), or (F) in which such individual did not engage in self-employment and did not render services for wages (determined as provided in paragraph (5) of this subsection) of more than the applicable exempt amount as determined under paragraph (8), in the case of an individual entitled to benefits under section 402(b) or (c) of this title (but only by reason of having a child in his or her care within the meaning of paragraph (1)(B) of subsection (b) or (c), as may be applicable) or under section 402(d) or (g) of this title, if such month is in a year in which such entitlement ends for a reason other than the death of such individual, and such individual is not entitled to any benefits under this subchapter for the month following the month during which such entitlement under section 402(b), (d), or (g) of this title ended.