The house was my primary residence for more than 5 years until I left California in 2015. I had roughly a $1M gain after deducting initial purchase price and property improvements. As I am no longer a CA resident, do I still have to pay CA capital gains taxes? If so, can I pre-pay them in 2017 and take some benefit on my 2017 federal tax calculations?