Usually caused by a blocked or partially blocked vent pipe.
When water is drained through the system and the vent pipe is blocked or partially blocked, the draining water creates a siphon that pulls the water out of the nearest trap (t create a "vent"), allowing sewer gas back into the home.
Go up on the roof (or get someone else to) above that bathroom and clear the main vent stack pipe sticking up out of the roof of leaves, debris, birdnest, etc. by hand, Flush the pipe down with a garden hose.
If that doesn't solve the problem, you may have to use a heavy-duty plumber's snake down the vent stack to clear it and then flush it down.
Then your shower trap should hold water and prevent the sewer gas.