Because the house was in Oregon, you will have to pay tax to Oregon on the gain. The gain is also taxable in Montana since that's your state of residence; however, you will receive a credit on your Montana tax return for the tax paid in Oregon. If the tax on gain in Oregon is more than Montana, you will only receive a credit for the amount of the Montana tax.