Why would a 2002 Chevy Express brake lights work when the headlights are off but when you the headlights are turned on the brake lights are on and go off when you press the pedal?

i found it to be the tail light harnesses go bad . a common problem with them because the bulb sockets short out.