The landlord can withhold the deposit for damage beyond what would be normal wear and tear. See Civil Code Section 1950.5. According to California Dept. of Consumer Affairs that does a great job summarizing this doctrine:
"Normal wear and tear to carpets, drapes and other furnishings cannot be charged against a tenant's security deposit. Normal wear and tear includes simple wearing down of carpet and drapes because of normal use or aging, and includes moderate dirt or spotting. In contrast, large rips or indelible stains justify a deduction from the tenant's security deposit for repairing the carpet or drapes, or replacing them if that is reasonably necessary. One common method of calculating the deduction for replacement prorates the total cost of replacement so that the tenant pays only for the remaining useful life of the item that the tenant has damaged or destroyed. For example, suppose a tenant has damaged beyond repair an eight-year-old carpet that had a life expectancy of ten years, and that a replacement carpet of similar quality would cost $1,000. The landlord could properly charge only $200 for the two years' worth of life (use) that would have remained if the tenant had not damaged the carpet."
If the landlord withholds all or some of the deposit, the withholding is presumed valid unless/until challenged in Court by the tenant. It would be his word versus yours. If you have any proof (photos, etc, at time of walk-through) this can be used to help with the argument should this have to go to small claims court.
I hope this helps and clarifies. Please use the SEND or REPLY button to keep chatting, or please RATE when finished. You may always ask follow ups at no charge after rating. Kindly rate my answer as one of TOP THREE FACES/STARS and then SUBMIT, as this is how experts get credit for our time. Rating my answer the bottom two faces/stars (or failing to submit the rating) does not give me credit and reflects poorly on me, even if my answer is correct. I work very hard to formulate an informative and honest answer for you; please reciprocate my good faith with a positive rating.