XOR gate using simple switches
You need two SPDT (single pole, double throw) switches.  A SPDT switch will have three terminals - your two-terminal switch won't work.

The animated diagram you show is what you want.

EDIT (after OP's comment)

This is the required circuit:







simulate this circuit &ndash; Schematic created using CircuitLab

If both switches are up, or both are down, the lamp will light.  If the switches are in opposite positions (one up, the other down) the lamp will be off.

A single SPDT switch and a relay won't work, since your original question required two switches.