If you’re going through a divorce, taxes may be the last thing on your mind, so we’re here to help. We’ve got tips for you on which filing status to choose after the divorce, who can claim the exemptions for the kids, and how payments to an ex-spouse are treated for tax purposes.

Couples who are splitting up but not yet divorced before the end of the year have the option of filing a joint return. The alternative is to file as married filing separately. It’s the year when your divorce decree becomes final that you lose the joint return option. In other words, your marital status as of December 31 of each year controls your filing status for that entire year.

If you can’t file a joint return for the year because you’re divorced by year-end, you can file as a head of household  (and get the benefit of a bigger standard deduction and gentler tax brackets), if you had a dependent living with you for more than half the year, and you paid for more than half of the upkeep for your home.

Exemptions for dependents

You can continue to claim your child as a dependent on your tax return if he or she lived with you for a longer period of time during the year than with your ex-spouse. In this case, you’re called the custodial parent. (It’s possible for the non-custodial parent to claim the exemption for a dependent child if the custodial parent signs a waiver pledging that he or she won’t claim it.)

Medical expenses

If you continue to pay a child’s medical bills after the divorce, you can include those costs in your medical expense deduction even if your ex-spouse has custody of the child and claims the dependency exemption.

Tax credits

If you’re the parent who claims the dependent exemption, you’re also the one who can claim the child credit (up to $1,000) and the American Opportunity higher education credit (up to $2,500) or the Lifetime Learning higher education tax credit (up to $2,000). The other side of that coin is that if you can’t claim the exemption, you can’t claim these credits.

You can continue to claim the child care credit for work-related expenses you incur to care for a child under age 13 if you are the custodial parent of that child, even if your ex-spouse gets to claim the dependency exemption. Put another way, you can only claim this credit for expenses to care for a child if you are the custodial parent of that child.

Payments to an ex-spouse

If you’re the spouse who is paying alimony, you can take a tax deduction for the payments, even if you don’t itemize your deductions. Keep in mind, though, that the IRS won’t consider the payments to be true alimony unless they are made in cash and spelled out in the divorce agreement. Your ex-spouse, meanwhile, must pay income tax on those amounts. (Be sure you know your ex-spouse’s Social Security number. You have to report it on your tax return in order to claim the alimony deduction.)

The opposite is true for child support: The payer doesn’t get a deduction and the recipient doesn’t pay income tax.

Asset transfers

When a divorce settlement shifts property from one spouse to another, the recipient doesn’t pay tax on that transfer. That’s the good news. But remember that the property’s tax basis shifts as well. Thus, if you get property from your ex-spouse in the divorce and later sell it, you will pay capital gains tax on all the appreciation before as well as after the transfer. That’s why, when you’re splitting up property, you need to consider the tax basis as well as the value of the property. A $100,000 bank account is worth more to you than a $100,000 stock portfolio that has a basis of $50,000. There’s no tax on the former but when you sell the stock, you’d owe tax on the $50,000 increase in value.

Home sales

If as part of your divorce you and your ex-spouse decide to sell your home, that decision may have capital-gains tax implications. Normally, the law allows you to avoid tax on the first $250,000 of gain on the sale of your primary home if you have owned the home and lived there at least two years out of the last five. Married couples filing jointly can exclude up to $500,000 as long as either one has owned the residence, and both used it as a primary home for at least two out of the last five years.

For sales after a divorce, if those two-year ownership-and-use tests are met, you and your ex-spouse can each exclude up to $250,000 of gain on your individual returns. And sales after a divorce can qualify for a reduced exclusion if the two-year tests haven’t been met. The amount of the reduced exclusion depends on the portion of the two-year period the home was owned and used. If, for example, it was one year instead of two, you can each exclude $125,000 of gain.

What happens if you receive the house in the divorce settlement and sell it several years later? Then you can exclude a maximum $250,000 gain. The time your spouse owned the place is added to your period of ownership for purposes of the two-year test.

Transfer of retirement assets

Handle your retirement savings with care in a divorce. If you cash out a 401(k) plan to give money to your ex-spouse, for example, the IRS considers that a taxable distribution—and you’ll be stuck paying the tax.

The way to avoid this tax-trap is to have the transfer accomplished under a Qualified Domestic Relations Order (QDRO), which gives your ex-spouse the right to the funds and relieves you of the tax burden. You don’t need a QDRO to transfer IRA funds, but the transfer should be spelled out in the divorce agreement so that it’s not treated as a taxable distribution to the IRA owner.