First you must choose the appropriate method for calculating the relationship to a given task. Your requirements imply that you need to select the option "Use task status" in "Administration" - "Settings" - "Task Tracking".

Then you define the status relations in the section "Administration" - "Settings" - "Task statuses" separately for each state.

% Done . . , " " " ", .