If you have access to a multimeter, you can check the voltage at the wires one by one. The one that gives +12v only when the head unit is turned on, is the one that you need. If you dont have a multimeter, take a bulb with its holder, the one thats used in speedometers, parking lamps etc also known as a 'machar bulb' in the local language, connect one wire of the holder to the ground and check the wires at the back with the other wire of the holder. The one that turns on the bulb, only when the headunit is turned on, is the one that you need.