Trying to describe this in text is very difficult so have a look at the attached link which explains with diagrams how the cable that runs down to the light switch is linked up to the ceiling rose. The difference is that you want two lights from the one switch. It means you must connect them in parallel, so the the Live wire that has been down to the switch and then back up to the junction box is connected inside the box to BOTH of the Live cables that then go off to the Rooms A and B.
You must have a two-way switch and you are attempting to use all three terminals in the switch box if you are getting the lights to alternately toggle. You only need to use two of the three terminals, labelled COM and either L1 or L2. (You need to use the switch as a one-way switch only). The link I give you says such work must be checked by a qualified electrician. That is not true for what you are trying to do but please take care and if in doubt ask a qualified person to help you.
http://www.diydoctor.org.uk/projects/lights_an d_switches.htm