It's definitely a good time to sell a home. In fact, according to ATTOM Data Solutions, the average home seller made a whopping $94,000 in profits last year. That's up 45% from 2020 and 71% compared to just two years ago.

For those selling a primary residence, these profits were mostly money in the bank. Sellers of second homes and vacation properties, though? That's a different story. That's because gains on second homes are taxed differently than those on primary homes. With a primary residence, you can exclude capital gains up to a certain amount. Sellers of second homes and other investment properties, on the other hand, have to pay taxes on those profits -- and often at a hefty price.

Are you considering selling your second home or vacation property? Here's what you need to know.

Coming soon sign sits in front of house.

Image source: Getty Images.

1. You will owe capital gains taxes

Capital gains taxes are levied anytime you sell an asset you've held over a year. You pay them on the profit you made in the sale (not the actual sale price), minus any improvement and transfer costs.

The capital gains tax rate is based on income, but for most people, it's 15%, so about $7,500 per every $50,000 in profit. Here's a full breakdown of tax rates by income:

Income

Tax Rate

Single filer: $0 to $40,440
Married/joint filer: $0 to $80,800

0%

Single filer: $40,441 to $445,850

Head of household: $54,101 to $473,750

Married/filing separately: $40,401 to $250,800

Married/joint filer: $80,801 to $501,600

15%

Single filer: $445,851 and up

Head of household: $473,751 and up

Married/filing separately: $250,801 and up

Married/joint filer: $501,601 and up

20%

Data source: IRS.

Primary residences are excluded from the above taxes, at least up to $250,000 in profits if you file your returns solo or $500,000 if you file jointly.

2. There may be a way around capital gains taxes -- but you must plan ahead

There are several strategies that can help you avoid capital gains taxes when you sell your second home, but they do take some forethought. 

The first is to live in the home for an extended period of time. As long as you live in a property for at least two of the last five years (it doesn't have to be consecutive), it will qualify as a primary residence and be exempt from capital gains taxes.

If that's not possible, you might also consider selling once you're in retirement, when your taxable income is much lower. This can help reduce or even eliminate the amount of capital gains taxes you'll owe on the sale.

Finally, you can sell fast. Selling before the one-year mark is up will qualify as a short-term gain, which is only taxed as income (so your typical tax bracket). Depending on how much you make annually, this may or may not be beneficial.

Prepare for the tax implications of your sale

It's easy to see today's home prices and feel tempted to sell your house. Just make sure you factor in the tax implications first and, if possible, time your sale accordingly. 

And if right-timing isn't in the cards, try to budget plenty of money for capital gains taxes. Set aside a portion of your profits in an out-of-sight bank account, and plan to leave those funds untouched until tax day rolls around.