for the lambda sensor the loom colours are as follows
brown and white = lambda sensor signal to ecu at pin 2
brown = sensor earth to chassis or engine block this wire also provides an earth for pin 1 on the ecu
black = this is the sensor supply for its internal heater and is switched via the ignition switch
as far as the sensor wire colours are i,m almost sure the red is the heater supply,the black is the signal to the ecu and the white is the earth