As per the given situation, the object that appears above the object when you are sitting or the object that appears below the other when you are standing is near to you. Here, object A is above the object B when you are sitting and object A is below the object B when you are standing.
Therefore, object A is near to you and object B is away from you.
When you are sitting the light rays coming from object B which is beyond object A, has to pass through the object A and therefore the object A seems to be above object B. The situation is shown in the below figure.
Whereas when you are standing the rays coming from object B are passing above the object A. therefore object B seems to be above the object A.