This excerpt is from the Md Attorney General website:
The landlord must return a tenant's security deposit plus interest, less any damages rightfully withheld, within 45 days after the tenancy ends. If the landlord fails to do this without a good reason, you may sue for up to three times the withheld amount, plus reasonable attorney's fees.
If the landlord withholds any part of your security deposit, he or she must send you a written list of damages, with a statement of what it actually cost to repair the damages, by first-class mail to your last known address within 45 days after you move out. If the landlord fails do this, he or she loses the right to withhold any part of the security deposit.
You have the right to be present when the landlord inspects your rental unit for damages at the end of your lease, if you notify the landlord by certified mail, at least 15 days prior to moving, of your intention to move, the date of moving, and your new address. The landlord must then notify you by certified mail of the time and date of the inspection. The inspection must be held within five days before or five days after your move-out date. The landlord must disclose these rights to you in writing at the time you pay the security deposit. If the landlord does not, he or she forfeits the right to withhold any part of the security deposit for damages.
Your rights and duties are different if you have been evicted for breach of the lease, or have left the rented property before the lease expired. Under these circumstances, in order for you to receive the security deposit plus interest, you must send a written notice to the landlord by first class mail within 45 days of being evicted or leaving the property. This notice must advise the landlord of your new address and request the return of your deposit. Once the written request is received, the landlord must then take certain steps.