Unless you or your cotenants misbehaved, a landlord may not kick you out in the middle of a lease.
A lease for a fixed length of time (a year, or 6 months, for example) is binding on both parties. You promise to pay the rent for that period, and he promises to let you stay for that period. He cannot arbitrarily end the lease before the period expires (unless the lease so provides, which is rare).
But if you fail to pay the rent, start wrecking the place, or breach a provision of the lease in some significant way, the landlord may give you a notice telling you to cut it out or get out. And if you fail to do either within the time specified in the notice (usually about 3 days), he may bring a lawsuit to evict you.
When trying to get your security deposit, some landlords refuse to return all or parts of security deposits unfairly, knowing that it is difficult for a tenant who has moved away to return and sue. So when you move out, clean the premises properly and then ask the landlord to tour the premises with you so you can work out any disputes then and there. After you've left, you might not be able to get back in to verify your claim (especially if another tenant has taken possession).
If all else fails, don't be afraid to sue. If the landlord refuses to return a security deposit that you have coming, sue him for breach of contract. Some states even allow you to recover extra "punitive" damages if he withheld the deposit "in bad faith." You may bring your own suit in small claims court, or ask a tenant lawyer to represent you.
What about eviction after the lease has expired?
A tenant who remains after the lease formally ends is called a holdover tenant. In this situation, a landlord can file an eviction lawsuit or instead, can choose to continue accepting rent payments, thus automatically converting the lease into a month-to-month tenancy. It is the landlords choice to evict or to continue accepting an agreed upon rent.
Since the landlord has the choice of eviction or renewal, the tenant who needs to stay past the end of the lease should attempt to negotiate a new agreement with the landlord. If you do this, make sure all the terms are reduced to a writing and signed by both the landlord and the tenant.
For more information on tenants rights and eviction visit GotTrouble.com