(a)
(b)
(i) If a return was filed, and a claim is filed within 3 years from the time the return was filed, the amount of the credit or refund shall not exceed the portion of the tax paid within the period, immediately preceding the filing of the claim, equal to 3 years plus the period of any extension of time for filing the return.
(ii) If a return was filed, and a claim is filed after the 3-year period described in subdivision (i) of this subparagraph but within 2 years from the time the tax was paid, the amount of the credit or refund shall not exceed the portion of the tax paid within the 2 years immediately preceding the filing of the claim.
(iii) If no return was filed, but a claim is filed, the amount of the credit
(iv) If no claim is filed, the amount of the credit or refund allowed or made by the district director or the director of the regional service center shall not exceed the amount that would have been allowable under the preceding subdivisions of this subparagraph if a claim had been filed on the date the credit or refund is allowed.
(2) In the case of a tax payable by stamp:
(i) If a claim is filed, the amount of the credit or refund shall not exceed the portion of the tax paid within the 3 years immediately preceding the filing of the claim.
(ii) If no claim is filed, the amount of the credit or refund allowed or made by the district director or the director of the regional service center shall not exceed the portion of the tax paid within the 3 years immediately preceding the allowance of the credit or refund.