How do the lights on stairs work?
In the drawn position the lamp will be on. Switching any switch will turn it off, and again any switch will turn it on again.

If you need more than two switching points you have to add "cross-switches", like this:



You have two A-type switches (for A and B) and the others are C-type.

edit
Any manufacturer of residential switching material has those cross-type switches, but in case you would ever need them in a DIY circuit with rocker switches, you can emulate them with DPDT switches. I'll leave it as an exercise for the interested reader to find out how to wire them. :-)