How do you rewire a switch in a hallway that turns lights on and off in two bedrooms?

Are you wanting to reconfigure it to work this way, or does it currently work in this manner?

To reconfigure it, it will take quite a bit of rewiring, depending on whether the rooms are adjacent or not.

The wiring method is not terribly difficult. Getting the wires to and from the switch can be cumbersome though.