Responses
So basically, he knows that they are twins. There's only Hangyum and Hanwool. Technically, he doesn't know Hanwool. If one of them is Hanwool, a stranger, then the other one has to be Hangyum, his highschool situationship. Because he ended up eating with Sohyun, who knows the twins personally, he knew for a fact that the twin he was with was Hanwool. If one twin is Hanwool then the other, Lee Han, must be Hangyum.

So the twins are named Lee Hangyum and Lee Hanwool. Hanjin and Hangyum went to school together and had a thing. Hanwool does not know Sanjin because he didn't go to the same school.
The confusion comes in with the translation. In the original Korean story, Hangyum goes by a different name. He's called Lee Han. That is a full name. That's what everyone calls him. Anybody who doesn't know him from the past would only know him as Lee Han. So when he and Sangjin met again, Sangjin's like "Dude, I know that you're Hangyum" and Lee Han pretends like he isn't actually Hangyum, which he is. But, Sangjin relents and accepts that he must be a different person.
The problem is that, for some reason, they completely got rid of Lee Han in the English translation. They just use Hangyum. So all throughout the English story, he's been calling Hangyum as Hangyum which frames the story as if someone would believe that someone who looks exactly like their friend, with the same voice and name, might actually not be that friend. That is ridiculous.
So when Sangjin met Hanwool the first time, it only made sense that he was Hangyum because the person he is dating is Lee Han. And Hanwool was actively pretending to be Hangyum because his brother asked him to. Then he found out that Hanwool was not Hangyum which meant that Lee Han must be Hangyum.