its because there is only a single way to reach that console, and shepard is bound to see him when he's moving towards it.

that aside, he shouldn't be on the citadell in the first place, he wasn't with you when you charged towards the beam.

for the third ending, you'll only be able to choose it if you managed to get a certain amount of war assets.