You are liable for the rent for June and 7 days of July and can not use the security deposit as last month's rent. Obviously you will not be able to convince the landlord otherwise. But since you are moving out within a few days it is not likely the landlord will be anything such as serving you with a three day notice. Your question is not really a legal; question, it is whether you should gamble on the landlord being honest and returning the security deposit you are entitled to.