There are three basic types of switch used for lighting circuits.
Typically, these terminals will be marked COM and L1, or sometimes L1 and L2. Either way, it does not matter which wire is connected where. Usually the permanemt live (from the supply) is connected to COM and the switched live (to the lamp) is connected to L1.
This is the most common type of switch, and is used where a light is controlled from a single switch.
Note that L1 and L2 are never connected together.
Again, some makes of switch may have alternative markings such as L1 L2 and L3.
This type of switch is used where two switches control one light, such as at the top and bottom of a stairway. It can also be used as a one way switch, by using the COM and L1 terminals only.
There are four terminals, usually L1, L1 and L2, L2. In one position, L1 and L2 are connected in pairs. In the other position, alternate pairs are connected. Refer to the diagram.
This can also be considered as two two-way switches combined.
In most domestic situations, this type of switch is not required or used. It can be used as a one or two way switch, but this is pointless as they usually cost much more than the one or two way types.
There are many other possible combinations, however for one-way switching it does not usually matter which way round the wires are connected.
If using a two way switch for one-way switching, and the switch appears to operate upside down, then move the wire from L1 into L2. For two way switches, swapping L1 and L2 will change the position of the switch when on. Normally, two way switches should be wired so that the light is off when both switches are off.