Capability is a certain ability, the quality of being capable, a potential aptitude.
Capacity is the ability to contain, that is: volume or amount that fits in a certain container for example. The maximum amount that something can contain.
It is also a certain rank: He/she was employed in the capacity of merchandising designer.
There are also other meanings, some are legal jargon, like "the Parliament´s capacity to create new laws", that means, legal competence exerted by a certain person or institution.