You need to dig into the lease agreement that you used to see what it says about specific issues like the security deposit and the terms under which you can either keep it or use it to fix broken items. Now, in most cases, a landlord can apply the security deposit toward the lost rent caused by a tenant’s early termination of the lease. Also, a tenant is responsible for returning the apartment to the landlord in about the same condition to which it was delivered, taking into account ordinary wear and tear. 

According to All Property Management, most leases say the tenant is responsible for any damage caused to the unit during his or her occupancy. One way to make sure you know what condition the property was actually in would be to have a written checklist of the condition of the property and have the tenant sign it to show that he or she agrees with the actual condition. Now you can back up any issues with photographic or video evidence. The way people tend to do is they have a big charge or checklists and they walk around and they check off everything with the tenant as they are moving into the unit, and then the tenant signs it. 

Most leases would provide that your tenant owes you at least the last two months, along with payment for any damage they caused to your unit. Even if there was not any damage to the unit, leaving the apartment in filthy condition could be enough of a reason to deduct reasonable cleaning expenses from the security deposit to bring it back into the shape the apartment was when you leased it to them. You need to read your lease and determine what the lease says happens in this sort of situation.