Q: I have 2 rental properties I want to sell. One is a townhouse and the other is a duplex. I have had conflicting advice on what kind and how much tax I will have to pay when I sell. Neither is my primary residence. Can you set me straight?

A: Rental properties fall under the category of investments. There are two kinds of investments — long-term investments, which are investments you have held longer than a year and short-term investments, which are those you buy and sell within a 12-month period.

When you sell a long-term investment, you have capital gains taxes to pay on any profit. The maximum tax you would pay would be 15 percent on your net profit. In the case of real estate that would be your profit minus the cost of purchase and the cost of sale of the investment. You would also subtract any maintenance or upkeep to the property that hadn’t been previously deducted.

If you sell the property within 12 months, that’s a short-term investment, and you would typically pay your marginal (or top) tax rate on your net profit.

If you have been depreciating your property, you’ll pay more tax. Essentially, you can depreciate your investment property, less the value of the land which can’t be depreciated, all the way down to nothing. When you sell, your cost basis is the depreciated price. So, if you’re depreciated your property down to almost nothing, and you sell it for $250,000, your net profit is about $250,000 (minus the costs of purchase and sale, and so on.)

If you want to avoid paying tax altogether, then you simply need to do a 1031 tax free exchange, also known as a Starker Trust. Essentially, you would sell your current investment property and purchase a replacement (that cost the same or more as the sales price) within a specified period of time. You would then defer any capital gains until you sell the new property.

If you’re going to do a 1031 tax-free exchange, you’ll need to work with a real estate attorney who knows his or her stuff. If you miss the deadlines, you’ll be out of luck. Consult with your tax advisor or accountant for more information about these options.

For additional information about how to handle depreciation, go right to the source. The IRS website (IRS.gov) allows you to download its documents for free. Check out IRS Publication 946 (“Depreciating Property”) as well as IRS Publication 527 (“Residential Rental Property”).