Example waveforms for XOR:

Notice that the XOR gate will produce a HIGH only when exactly one input is HIGH.