Parallax animation is an easy way to put life into a photograph.
And the easiest way to do it is through Adobe’s star products, Photoshop and After-effects.
There are many other popular names for this effect, such as Animated photos, 3D animated photos, Photo Multi-plane, parallax photo effect or 2.5D effect.
Let me break it down for you into three simple steps:
1) separate the foreground and the background layers,
2) fill the background
3) and then animate the layers.
Have a look at a detailed explanation of the same by VFX Guru Peter McKinnon: