Renting out your home, or even a single room, through a short-term rental service such as Airbnb, HomeAway or VRBO could earn you some cash—and a big tax headache. That’s because special tax rules apply. Here’s how home-rental hosts can minimize the tax hassles and dodge some potentially expensive tax traps…

Think twice before renting out your home for more than two weeks. The federal tax code offers a wonderful way to avoid paying any income tax on short-term rentals. If the property is your personal residence and you rent it for a total of no more than 14 days in a calendar year, no income tax is due. This provision can let you make substantial tax-free income if there is tremendous demand for rentals in your area during a particular window of time, such as when a big sporting event takes place nearby.

However, if you rent out your home or a part of it for a total of more than 14 days in a given year, all of your rental income becomes taxable and you have to navigate some complicated tax-reporting rules for claiming deductions.

Don’t assume that you don’t have to report rental income because you didn’t receive a 1099-K form from the rental service. Rental services such as Airbnb are required to mail you this form only if you earn more than $20,000 and have more than 200 transactions during the year. But even if this form is not mailed to you, the IRS will be informed about your earnings.

Set money aside to pay self-­employment taxes. Last year, the IRS clarified that home-rental hosts who rent out for more than 14 days and “provide substantial services” for tenants should report their income on Schedule C, ­Profit or Loss from Business, rather than Schedule E, Supplemental Income and Loss. “Substantial services” includes things that most Airbnb hosts do such as cleaning, changing linens or performing repairs. Self-employment taxes of 15.3% typically must be paid on Schedule C income.

Don’t forget to deduct your home’s depreciation. Although real estate itself often appreciates in value, buildings depreciate throughout their useful lives, and people who earn income renting out their homes (or portions) can deduct a portion of that depreciation. For details see IRS Publications 527, Residential Rental Property, and 946, How to ­Depreciate Property.

You might have to pay lodging tax or “transient occupancy tax.” Not all localities have these local and state taxes, but if yours does, they likely apply even if you rent out your home for no more than 14 days. Contact your town, city and/or county to check whether any such taxes exist—and if so, make sure these taxes get paid.