As a local realtor (now retired), I've seen this before and it can be legit BUT I strongly advise you NOT to rent here. First, the landlord will NEVER return the security deposit to you. The landlord has a legal obligation to return it to the tenant currently living there - not you. Obviously this tenant wants you to pay the security deposit to him because he needs instant cash to give his new landlord a security deposit - something he doesn't have now. That's his problem - not yours.
Next - Any landlord requesting you to pay 2 months rent upfront to finish a previous tenant's lease is a greedy landlord trying to skim money off of you to make a profit. Don't fall for this. If you rent from this landlord, be prepared for more greedy tactics in the future. Examples: if something breaks and you need the landlord to fix it - this landlord will expect you to pay for it + will increase your rent to make a profit.
Bottom line - find a different rental. Expand your search to neighboring towns.