Two people are sitting on a rock looking off into the distance.
Two people are outdoors.
People sitting on a rock means the rock is most probably outdoors.
People are outdoors sitting on a rock.
There are two people, and they are sitting on a rock, which is typically outdoors, and looking into the distance, which is also used to describe outdoor locations; therefore the people are outdoors.