(a) General. -- A nonresident shall be allowed a credit against the tax otherwise due under this article for any income tax imposed for the taxable year by another state of the United States or by the District of Columbia, of which the taxpayer is a resident.
(b) Limitation. -- The credit under this section shall not exceed either:
(1) The percentage of the other tax determined by dividing the portion of the taxpayer's West Virginia income which is also subject to the other tax by the total amount of his income subject to such other tax, or
(2) The percentage of the tax otherwise due under this article, determined by dividing the portion of the taxpayer's West Virginia income which is also subject to the other tax by the total amount of the taxpayer's West Virginia income.
(c) Exceptions. -- No credit may be allowed under this section for a taxable year beginning after the thirty-first day of December, one thousand nine hundred eighty-seven, except pursuant to a written agreement between this state and the nonresident individual's state of residence. The state tax commissioner is hereby authorized to enter into such agreements necessary to effectuate the purpose of this section when he determines that such agreements are in the best interest of this state and its residents.
(d) Definition. -- For purposes of this section West Virginia income means:
(1) The West Virginia adjusted gross income of an individual, or
(2) The income derived from West Virginia sources by an estate or trust, determined in accordance with the applicable rules of section thirty-two as in the case of a nonresident individual.