(1) For purposes of the tax imposed under this chapter, long-term capital gains and losses are allocated to Washington as follows:
(a) Long-term capital gains or losses from the sale or exchange of tangible personal property are allocated to this state if the property was located in this state at the time of the sale or exchange. Long-term capital gains or losses from the sale or exchange of tangible personal property are also allocated to this state even though the property was not located in this state at the time of the sale or exchange if:
(i) The property was located in the state at any time during the taxable year in which the sale or exchange occurred or the immediately preceding taxable year;
(ii) The taxpayer was a resident at the time the sale or exchange occurred; and
(iii) The taxpayer is not subject to the payment of an income or excise tax legally imposed on the long-term capital gains or losses by another taxing jurisdiction.
(b) Long-term capital gains or losses derived from intangible personal property are allocated to this state if the taxpayer was domiciled in this state at the time the sale or exchange occurred.
(2)(a) A credit is allowed against the tax imposed in RCW
82.87.040 equal to the amount of any legally imposed income or excise tax paid by the taxpayer to another taxing jurisdiction on capital gains derived from capital assets within the other taxing jurisdiction to the extent such capital gains are included in the taxpayer's Washington capital gains. The amount of credit under this subsection may not exceed the total amount of tax due under this chapter, and there is no carryback or carryforward of any unused credits.
(b) As used in this section, "taxing jurisdiction" means a state of the United States other than the state of Washington, the District of Columbia, the Commonwealth of Puerto Rico, any territory or possession of the United States, or any foreign country or political subdivision of a foreign country.