Every husband and wife, and each other person, described as a taxpayer in § 12-505 shall, in addition to the exemptions allowed under the provisions of § 12-506c, be allowed an exemption and deduction from the amount of gains from the sale or exchange of capital assets for any taxable year which are subject to the tax imposed under the provisions of § 12-506 in the amount of any gain for such taxable year included in net gains from the sale or exchange of capital assets for federal income tax purposes, as described in § 12-505, arising from the sale of a residence in such taxable year, but only if (a) either of such spouses or both, or said other person, had attained the age of sixty-five years on the date of such sale and had owned and used such residence as principal residence for at least five years of the eight years immediately preceding the date of such sale and, (b) said gain is the first such gain for such taxpayer with respect to the sale of such a residence on or after January 1, 1974. If the exemption provided for in this section is availed of by a taxpayer in or for any taxable year, no such exemption shall be allowed with respect to such taxpayer or a spouse thereof in any subsequent taxable year. For the purposes of this section, the word “sale” means a “sale”, “exchange”, “transaction” or “event” through which the taxpayer is divested of all interest in his residence.