How to check if sprites overlap then Hide the one behind

That is a bit tricky. You can try to compute the 2D AABB of a spite in screen space and then test if they are intersecting. If so, you hide the sprite with the higher z (depth) value.