If you mean a light switch with three terminals marked Com, L1 and L2 - AND - you have two wires plus an Earth then...
The Earth connects to a terminal in the wall box if one is present - The other two wires are Live in and Switched Live out (to turn the light on and off) One should connect to the Com terminal and the other to either L1 or L2 it really makes no difference.
If you mean something else than you might consider another question with more detail. The term "2 way switch" can have more than one meaning.
Good luck...
Peccavi
May 2010