There are some things you can do as a landlord:

Declining to rent to someone due to poor credit or references is acceptable, but speak to a lawyer before declining for any other reason.Increasing the rent is fine, but only at certain times and within certain percentages, so check your state’s code to make sure you’re within those boundaries.You can deduct from security deposits for damage done by the tenant, but not for reasonable wear and tear.

Illegal Actions Landlords Can’t Take

And then there are illegal actions you may not realize you’re taking as a landlord:

You can’t lock tenants out of their dwellings without first getting a court order for eviction, even if they haven’t paid rent in months.You can’t retaliate against tenants for complaining about uninhabitable conditions.You can’t enter a rented dwelling without first providing reasonable notice, except in the case of emergencies.

Learning more about what to do in certain situations can help you know how to handle them if and when they arise with a renter.

Nonpayment of Rent

For whatever reason, you can’t simply lock your tenant out of the dwelling if they don’t pay their rent. Instead, you must move through proper legal channels and take them to court to get an eviction order first. You might want to avoid a lengthy eviction process. You might also want to avoid the risk that the tenant will pay the rent due when they get to court but will stop paying again right after the court date.

Problem Tenants

Tenants sometimes cause problems at the rental property, such as disturbing or harassing other tenants, conducting illegal activities out of their apartment, or breaking other clauses of the lease. Again, you must evict through the legal system. You can’t take unauthorized action on your own.

Tenant Complaints

You shouldn’t retaliate against tenants who have made complaints about the rental property. The tenant might have made these complaints to you already or might have filed a formal complaint with the municipality or state. In either case, you can’t react by hiking the rent or filing an eviction action. You can’t harass the tenant or make the living conditions so uncomfortable that the tenant leaves the property, such as by refusing to make necessary repairs.

Increasing the Price of Rent

Let’s say you want a tenant out of the rental property so you can charge more rent to a new tenant. This commonly happens with rent-stabilized apartments or apartments where protected tenants reside. The rent can only be increased by a certain percentage each year in rent-stabilized apartments, so a tenant who has been there for 15 years might be paying far below the market price for the unit. Protected tenants are similar in that you can only increase the rent by a certain percentage each year. These tenants cannot be evicted except for very specific reasons. There are specific rules for how often you can increase a tenant’s rent and how much you can increase it. You must give proper notice, such as 30 to 60 days, before a lease renewal. You can’t increase the rent by more than is legally allowed in your state, such as by demanding a 10% increase when the maximum allowed by the state is 5%.

Discriminating Against Tenants

You might prefer to only rent to married couples or might not want college students renting together. You might even want to avoid having to make reasonable accommodations to the property for a tenant with a disability. This all falls into the category of discrimination. Refusing to rent for any of these reasons is illegal and can open you up to a serious lawsuit. A landlord is legally responsible for following fair housing laws. There’s a federal Fair Housing Law and most states have additional fair housing rules that landlords must follow. Make sure you’re up to date on these laws. Two of the most common times a landlord violates the fair housing laws is when they’re posting ads to fill a vacancy or actually screening and interviewing tenants. Be careful and choose your words wisely.

Increasing Property Expenses

You might unknowingly perform illegal actions to make up for an increase in costs such as property taxes, insurance, utilities, or maintenance. This could include trying to save money by hiring unskilled workers to perform repairs for less money or refusing to schedule required property inspections. Don’t do that; if your costs go up as a landlord, discuss your options with a lawyer and realtor.

Refusing To Make Repairs

You are required to keep the rental property in a habitable condition, so it’s illegal to refuse to make repairs that can affect a tenant’s health or safety. You also don’t want to make the repairs but illegally hire unlicensed contractors to do the work, such as electrical or plumbing. It’s likely that your town requires licensed professionals to perform the work. If you are aware of a health or safety issue at the property, do not try to cover it up instead of fixing it. For example, there could be a known lead paint hazard. Don’t avoid the costly lead paint remediation by installing decorative molding over the hazard. This is breaking the law.

Entering the Property Without Proper Notice

Another prohibited act is not respecting a tenant’s legal right to privacy. You have a right to enter a tenant’s apartment in an emergency, but you must give the tenant proper notice in almost all other situations. The amount of notice is usually spelled out in your state’s landlord/tenant laws and, if not, it should be clearly stated in advance in your lease agreement. In addition to proper notice, the landlord can only enter the apartment for legal reasons, such as to show the unit to prospective tenants or to make repairs. Do not place cameras or recording equipment inside a tenant’s apartment. This is completely illegal no matter what the reasoning behind it.

Not Getting Required Inspections

Some landlords rent out apartments without getting the required inspections done first. Some states require a new certificate of occupancy or a habitability inspection each time the unit is rented to someone new, or sometimes every few years. Some states or towns require fire inspections prior to renting, confirming that the unit has the proper number of carbon monoxide or smoke detectors and that they’re in working order.

Making Illegal Deductions From the Security Deposit

A landlord might try to keep a tenant’s security deposit for “repairs,” such as damage to the property that actually occurred prior to the tenant moving in, or for other fake breaches in the lease agreement. Legitimate reasons to keep a security deposit include unpaid rent and damage to the unit that you can tie back to the renter. Ordinary wear and tear do not warrant deducting money from the security deposit. Want to read more content like this? Sign up for The Balance’s newsletter for daily insights, analysis, and financial tips, all delivered straight to your inbox every morning!