You are absolutely right if your Assured shorthold tenancy agreement is dated after the 6 April 2007 the agent should have deposited your deposit under the terms of the Deposit protection scheme (DPS) which is not optional and you should have been notified. If you had paid the rent and complied with the other terms of the agreement you should not have been asked to leave after 5 months with a fixed term of 12 months, the minimum fixed term is 6 months, not having complied with the DPS or your tenancy agreement a number of options are not available to the agent, who can be fined for his failure to comply with the DPS.
English law likes reasonableness so first write to the agent by recorded delivery and keep a copy of your letter, remind them of their responsibilities regarding the DPS and the fixed term of your tenancy ask for any money withheld to be returned and your costs (be reasonable). Give 30 days to pay you and if this is ignored send “a letter before legal action” giving a further 30 days to pay warning them that if they do not pay you intend to take action in the county court.