The amount is capped. Your landlord may require a security deposit to guarantee payment of rent, unpaid charges, or repair of any damage you may have caused, but this amount cannot exceed two months' rent (art. 20).
Its return is regulated:
- The deposit must be returned to you within one month from the date you hand back the keys (art. 20).
- The landlord may deduct sums that are still owed to him, provided they are duly established — he cannot withhold money on the basis of mere allegations (art. 20).
You may also agree with him to set this deposit aside to cover the rent for the final months of the lease (art. 20).
Note: you are not liable for deterioration resulting from habitual and ordinary use, from wear and tear, or from an event of force majeure (art. 14). A landlord therefore cannot dip into your deposit for normal wear. To protect yourself, make sure a detailed inventory of condition is drawn up both on entry and on departure (art. 7 and art. 8).
This is general legal information, not legal advice. For advice on your specific situation, consult a lawyer admitted to the Bar in Morocco.