How did you get the 'Castle' variable?
You must either pick it, or save it as an specific.
I would
Events
A unit is attacked
Conditions
Unit type of Attacked unit equal to Castle
Actions
Add to Event for (Trigger number 2) The event, Attacked unit's life becomes less than 200
Then you got this other trigger, which is named:
Events
Conditions
Actions
Change team, blablabl, color
Set life to 100%