He's referring to a unique Commander Sheppard, from a universe we haven't seen before.
There's a follow-up conversation that occurs toward the end of the episode:
McKay: Detective. Remember when I told you I once met another version of
McKay: I know you'll probably think this sounds ridiculous, but, a little a while ago we accidentally opened a rift in space-time. Went through to an alternate version of reality. It's very similar to ours in many ways. Met a team, much like the one I work with only, you were the leader. You were a hero. Saved the world, several times over.
Sheppard: Doesn't sound much like me.
McKay: I don't think there's much difference between you and that other John Sheppard I met. It's amazing how one incident can entirely alter the course of your life. Still, I like to believe you have the same strength of character. That's why I told you the truth.
According to notes on the Stargate wiki for this episode, the Commander Sheppard which this McKay met sounds very similar to the Sheppard we know in the show ("Sheppard Prime") however, there are a couple of discrepancies that suggest it wasn't our universe which this McKay visited. Or rather, discrepancies that rule out this McKay being any alternate-universe McKay we've seen in previous episodes in the "Prime universe" (of which there have been a couple.)
For example, the alternate McKay who came to our "Prime" universe in S03E08 had apparently already met the John Sheppard of his own reality, and it wasn't this guy.
It's possible this McKay was referring to Sheppard Prime, but that would mean there was an adventure not shown in other episodes from the "Prime Perspective." So, you'd have to depart canon information and go into "fan theory" territory if you want that to be the case.