Tub Spout

My outbreaks spout in the tub wall every time I try to go to the shower mode. How I can correct?
spout remains in a while water comes out of it, but when I turn the shower head, pulling the lever up the spout spout shoots the tank and the pipe is exsposed first.
If what you see is bare copper, no children, then called a sliding fit spout. A screw is tightened to hold the spout. The screws are located to the bottom of the spout. Tighten the screws with an allen wrench.