This is called occlusion and with ARKit 3.5 it's available.
You can achieve the results with the People Occlusion and Object Occlusion in ARKit 3.5 and above.