How to fix a bathtub faucet that leaks only when the shower runs?
Sounds like the washers/gaskets on the valve have gone bad, you'll have to either replace the washer or the entire valve (if you can find a replacement).
Here is what the valve may have looked like when it was new (just to give you an idea of what you're dealing with).

Removal

Turn off the water to the shower faucet using either a local shutoff valve or the main water valve for the house.

Turn the shower’s hot and cold water all the way on, to drain leftover water from the pipes.

Pry the cap out of the center of the diverter’s handle.

Remove the screw in the middle of the handle, and then pull the handle off the faucet.

Unscrew the metal sleeve that sits over the valve stem.

Insert a Shower Valve Socket Wrench over the valve stem and turn the dirervter anti-clockwise to remove it.




Replace the washer, or the whole diverter if you can find a replacement.

Apply some Silicone grease (plumbers grease) to the washer before replacing the diverter.



Installation
Installation is the reverse of removal.

Insert a Shower Valve Socket Wrench over the valve stem and turn the dirervter clockwise to install it.
Screw on the metal sleeve that sits over the valve stem.
Push the handle on the faucet, then replace the screw in the middle of the handle.
Push the cap into of the center of the diverter’s handle.
Turn the shower’s hot and cold water all the way off.
Turn on the water to the shower faucet using either a local shutoff valve or the main water valve for the house.