Mask it.
Open your image in Photoshop, click on the Background layer, then go to Layer > Duplicate Layer, name your layer or keep it as Background Copy, and click Ok.
Select the Background Copy layer and apply a mask to the subject you want objects to move in front of and behind. “If you have a simple, plain background, it’s very easy to do it with the Magic Wand,” says Ewa. Select the Magic Wand tool from the toolbar and either draw around your subject or use Select Subject from the Options panel, then click on Select and Mask in the Options panel. In the Select and Mask workspace you can refine your selection and apply the mask by choosing Layer Mask from the Output To dropdown menu and clicking OK.