You have to step through the logic. You had On B->Activated = True, followed by (On B AND Activated=True)->Activated = False. Both of those Triggers are going to be processed, in order, cancelling each other out. By having a single trigger check, you can then decide how to process it based on the Activated state.