Ask a landlord-tenant lawyer and get answers ASAP
My name is***** and I will be helping you with your question today. This is for informational purposes only and does not establish an attorney client relationship.
Normally the security deposit is not reserved for payment of last month's rent although many tenants use it for that. The landlord can bring suit against you for past rent but you should only have to pay the prorated amount of August for when you are in the apartment. At this point, you should do your best to clean the apartment and fix anything that is obvious. I would take pictures as evidence (this is very important, you should always take pictures of the place before you move in as well, just fyi). Ultimately any repairs the landlord documents plus rent from July and August (taking into account the $600 you paid plus interest) will be due the landlord minus the security deposit. If the landlord has to take you to court for the back rent then he/she will also be able to charge you any court costs plus attorney's fees, so I would take care of the rent if possible as these fees can increase quickly. Pay the past rent and hope for the best on your security deposit (it is there for repairs for the landlord - normal wear and tear cannot be charged). I would also figure out the rent that is actually due in August (if he gave you 30 days and there is no language in the lease that requires full payment for the month then it should be prorated), apply any overage to the July rent and pay the difference to avoid the hassle of court and most likely paying more on top of that for all the fees.
Please let me know if you have any further questions and please positively rate my answer as it is the only way I will be compensated. (There should be smiley faces or numbers from 1-5 next to my answer, an excellent or good rating would be fantastic.)