Exclusive OR
We can see from the truth table for XOR that the only way we can get a result of true is if only one of the operands is true.
So if A and B are different, the XOR of them is true. If A and B are the same, whether they are both true, or both false, the answer will be false.