Hoping that once your utility bills are all settled, the landlord should not have any reason to keep your deposit.
Did you do a ‘walk through’ with the agents/landlord at the beginning of the tennancy?
(An inventory of all contents and condition).
If you are having problems with him, ask him to see the documents where his property is registered with the Tax office/Hacienda and the local town hall. He must do both to comply with tax laws. Once you start asking these kinds of questions, I hope he will comply.
As above poster also said ^ the agent is obliged to assist you. If they will not, or start being difficult, it might be time to ask for the ‘Libro de Reclamaciones’ - the complaints book. All businesses must have one/present it (if they do not/refuse, you can actually call the local police to get them to enforce it, or at the very least give you a witness statement to that effect). Most people will act fast if you say you are going to do a denunica! (Not sure how it applies to landlords… but worth going to your OIC? Local Consumers office).
Sadly landlords will try to keep deposits. (My last landlord kept mine.. but luckily it was worth the money to get him out of my life forever???!!!!)