Tenant's Rights When Lease Falls Through Before Signing
Security deposit refunds are often a matter of state law or even city ordinances. As such, the rights conferred by security deposits (and rights to recover security deposits) vary greatly all over the United States. Generally, however, if you give a security deposit for an apartment that you don't ever take possession of or sign a lease for, then you are entitled to the entire deposit back. The lessor, however, has the right to lease out the apartment until the moment a lease is signed.
Usually, until you have actually signed a lease, you do not have a lease. Virtually all residential leases are required to be in writing: this is especially important in this case. Was there supposed to be a later signing, or did you understand there would be no other paperwork? It is possible you have a lease without signing, but it may be hard to prove.
If the landlord's actions were discriminatory it could be relevant, but property owners have very protected rights and many unfair acts are still quite legal. Still, if the refusal was made on prohibited grounds, e.g., racial discrimination, national origin, marital status, etc, then you can sue in court, and the consequences could be severe. This is difficult to prove, though. If you were denied a lease agreement by a landlord and were lied to (e.g. - they said someone else took the apartment when they in fact had no one else), then your options expand considerably. Consult with an attorney if you are unsure of your situation.
Sometimes the deposit may show the landlord "accepted" you as tenant. The receipt of a deposit may have created an agreement, but the agreement may only have limited rights, rather than being a full lease. You're usually entitled to it back. Some landlords try to keep some, or even all, of a deposit. The key in court is what you agreed to, or what the agreement seems to be, to an objective, reasonable person.
It probably doesn't matter whether the landlord called it a security deposit or a security agreement. The bottom line will be what kind of deposit a court can determine it is. Since you never took occupancy, the odds are it will be deemed a security deposit, designed to assure you'd move in. A security deposit in this case is meant only to "secure" the lease...and you're entitled to all of it back since you did not take occupancy...especially if someone else immediately took possession, through no fault or deceit on your part.
Try to avoid going to court. But if there's no other option, and the landlord is trying to keep your money, be prepared to present all the evidence you have. For example, how was it communicated to you that the apartment was rented? The more that was communicated in writing (including email messages or even text messages), the better. You should keep records of any phone conversations, including dates, times, and the content of each discussion. Be ready to show that you were ready and able to take possession of the apartment.