What is the third pipe leading to my water heater?
Here's my guess. The left pipe goes to the hot water faucet of a fixture with a common hot+cold spout. Since there is no hot water pressure at that faucet, when you open both faucets some of the cold water comes out the spout and some flows backward through the hot water faucet and spills out the left pipe. 

The left pipe may also connect to the hot faucets of some other sinks. The center pipe may connect to other hot faucets, or it may be a drain. 

If you can't trace the pipes inside the walls, you will need to force something to flow through the pipes so you can find where it comes out. The simplest thing to use would be water from a garden hose, or a hose temporarily connected to the cold water supply in your photo. Trim and smooth the ends of the pipes and use a flexible coupling to attach the hose.