When John sees Sherlock for the first time after the two years, he doesn’t right away get angry or relieved. Instead he gets scared as hell, because he can’t believe his eyes. His eyes are lying.
Sherlock is dead + I see Sherlock standing in front of me = I’m delusional.
The real person in this absurd and scary situation is Mary. So he turns to Mary, to check what he should do. Does Mary see the same as I see?
It’s almost a casual look. It looks like he could just ignore the vision of Sherlock if it seemed like Mary doesn’t see him at all. Maybe he wishes it’s just an illusion. Maybe it would have been easier. But what he sees when he looks at Mary is this:
Mary sees him as well. She confirms Sherlock is real.
I see Sherlock in front of me + I am not delusional = Sherlock is not dead.
Sherlock is not dead.
And only then he reacts.
how many times did john see sherlock when he wasn’t really there