I have 2 rooms, each has a switch and a light connected to it, how can I control the two lights using these 2 switches so that when one light is ON the other one is OFF, ie: at any moment only one light ON and the other is OFF. Thanks.
This answer is in two parts. Read both parts before proceeding.
The switch on the left is a "three-way" and the switch on the right is a "four-way". As usual, I have omitted the fault ground wires to make the diagram clearer.
This can also be done with four conductors between the switch boxes instead of five, if you confine all the wires in a conduit or single cable. Just combine the two neutral wires into one.
I have diagrammed the method that uses one 12/3 and one 12/2 because where I live, in the U.S.A., you can buy non-metallic sheathed 12/3wG and 12/2wG cable in any building supply store, while 12/4wG is relatively hard to find.
EDIT: I have updated the diagram with the color tapes suggested in Harper's answer.
Are you sure you want to do this? Unless you live in an abandoned missile silo, it doesn't make much sense to wire your home so that you can never turn off the lights. Are you going to have one light burning even in the daytime? Does no one sleep in your house?
Many people ask this question but no one has ever reported implementing it and being satisfied with the result.
Perfectly straightforward, but is likely to violate building codes not to mention cause fights between room occupants.
Building codes generally want to see you be able to turn on a light in any habitable room. Implied not explicitly stated: independently of each other.
Learn to stop worrying and love the burn
With LED efficiency these days, I fail to understand why anyone gets excited anymore about turning lights off. Yes, yes, using electricity usage as a metaphor for social/personal responsibility/frugality all that jazz... that might've mattered when the load was 100 watts, but at 7 watts who cares? A 7 watt bulb costs $7/year to burn 24x7. Time spent not having "teaching moments" with your kids: priceless.
Smart switches, and write any software code you want
This is the only way to do it without running a ton of wires in the walls.
Get a smart-switch system like Insteon that features a perfunctory programming language. Write code so switch 1 turns on lamp 1 and turns off lamp 2.
Then, later, when the building inspector finds this mess and writes you up for it, change the software back to normal.
Hard wire it
This setup requires power to come into one of the switches, call it switch 1.
Switch 1 gets a 3-way switch.
A /3 cable, proceeds to switch 2. White is neutral and black/red are re-taped to be yellow and carry 2 messengers.
Switch 2 is a 4-way switch. On one "side" of the 4-way (say, black screws) you attach the 2 yellow messengers.
A /2 cable goes from switch 2 to light 1. Its black wire gets marked brown on both ends, it is switched-hot. Its white wire is neutral.
A /2 cable goes from switch 2 to light 2. Its black wire gets marked red on both ends, it is also switched-hot. Its white wire is also neutral.
In each lamp, the remarked black wire, and white wire, feed the lamp.
Back in switch 2's box, the brown and red wires go to the two remaining (brass) screws on the 4-way. The neutrals are spliced together with the loose neutral.
Throwing either switch will change which light is on. One light will always be on because that is what you specified. If you wanted something other than that, the usual error isn't stating the problem - you did that plenty clear - it's in reasoning through every combination. That there is the difference between a programmer and a systems analyst.