Filing your taxes when you move out of state can quickly become complicated. Consider all of these factors before you file.

Q: We sold our house in Connecticut and moved to Virginia. Do we have to file income taxes in both states? Our house was sold in end of July of last year and we moved into our townhouse in November.

A: Aside from the issue of the sale, you might have to file income taxes with both states if you earned income during the entire year. Connecticut will want to tax your income while you lived in Connecticut and Virginia will want to tax your income while you lived in Virginia.

As with most income tax issues, it gets complicated. You lived in Connecticut and sold your Connecticut home. If you made money on the sale of the Connecticut home, Connecticut will want to collect whatever taxes it is entitled to from you. If you do file in both states, that doesn’t mean that you’ll pay double the taxes. Usually when it comes to filing income taxes in multiple states, one state will credit you with whatever taxes you paid the other state.

We don’t know what your situation is with your job or other finances, but if you do have to file in two states and your taxes are already complicated, you may need to hire a professional to help you out. If your taxes are simple, you might be able to do it yourself with the help of some of the software programs out there that help you file taxes.

Keep in mind that the sale of your home may not affect your federal income taxes. If you are have used the home for two out of the last five years as your primary residence, the IRS gives you the right to exclude up to $250,000 in profits (up to $500,000 if you’re married, filing jointly) from any taxation. If your state treats the sale the same way, the sale shouldn’t affect your state income taxes. But if your state does not treat the sale and you have a tax to pay, you’ll have to pay that tax when you file your state taxes.

Since the sale of the home was in a different state, the state you move to will not look for taxes from you for your earnings from the time you lived in that other state or for the sale of assets while you lived in that other state.

We’ve given you a very simplified version of what you can expect, but as we said upfront, when it comes to taxes, it is and can be complicated. If you need more information, we’d urge you to talk to an enrolled agent or other tax professional.