Let's say I sold my house in California and I estimate the amount that capital gains will be taxed (basis + costs + exemption of 250,000/500,000 if it was your primary residence) and there's an amount leftover. Then I plan on moving to Arizona within a few months afterwards. Would I be taxed CA's rate or AZ's rate on the amount leftover? Also, is there a way to avoid capital gains altogether?
I researched that it's based off your income bracket but what happens if you never done taxes before (aka jobless or never received income to report)?
Edit: The house was gifted. I guess another follow-up question. Would the basis be higher than the sale price it was brought, same or be counted as $0? (House was brought sometime 2012 and gifted 4 years later 2016)
Thanks