A repair corrects damage. If a car hit the house it may be a repair to fix the stumping and re-situate the joists on the stumps.
If something deteriorates than it is capital expenditure.
If something breaks / stops operating and you replace only the broken part that is a repair. If it is...