certain legally married couples (1) In general If— (A) an individual has filed a separate return for a taxable year for which a joint return could have been made by the individual and the individual's spouse, but for the fact that the spouses were first treated as married for purposes of this title by the application of the holdings of Revenue Ruling 2013–17 after the filing of the return of tax for such taxable year, and (B) the time prescribed by law for filing the return for such taxable year has expired, such individual and the individual's spouse may nevertheless make a joint return for such taxable year. (2) Rules and limitations (A) In general The election provided for under paragraph (1) may not be made after the later of— (i) the expiration of 3 years from the last date prescribed by law for filing the return for such taxable year (determined without regard to any extension of time granted to either spouse), or (ii) the date prescribed by law (including extensions) for filing the return of tax for the taxable year that includes the date of the enactment of this subsection. (B) Other rules The rules of— (i) so much of subsection (b)(1) as follows the first sentence, (ii) subparagraphs (B), (C), and (D) of subsection (b)(2), and (iii) paragraphs (3), (4), and (5) of subsection (b), shall apply to a joint return under this subsection as if it were a joint return under subsection (b). .