In general, if you as a tenant break the lease early, the landlord could keep the security deposit. Check the specific terms and conditions of your lease and also local laws (that might override unlawful provisions in a contract). In a month-to-month lease, the landlord needs to give you back your deposit, because you’re not ending the lease early.