Winston and O'Brien have a moment during the hate episode in which they make eye-contact. This eye-contact excites Winston because it convinces him that he has a friend and potential ally in O'Brien. From that, he takes heart and hope.
They do not actually have a conversation at this point (although they do later, when O'Brien invites him over to his house to see the new "dictionary"). The eye contact is enough for Winston to believe that O'Brien may be a member of the Brotherhood, and that he, too, is an enemy of a Big Brother.
In the first chapter of the book, Winston and O'Brien make eye contact during the Two Minutes Hate. This contact is brief: according to Winston, they look at each other for only a "fraction of a second." For Winston, this moment is significant because it provides him with proof that he and O'Brien are the same. In other words, he now believes that O'Brien is a fellow rebel; a man who hates and is disgusted by the Party.
In the second chapter, nothing specific occurs between Winston and O'Brien. However, Winston talks about his dream in which he hears O'Brien's voice while walking through a "pitch-dark room." This further reinforces Winston's belief that there is a special bond between himself and O'Brien and this foreshadows their meeting in Part Two.
Winston believes that O'Brian is a member of the Brotherhood (which is said to be an underground organisation that works against the governing body, Ocenia - Big Brother).
The only reason behind this belief is a glance they exchanged. But eventually, it turns out that O'Brian is a solid member of the tought police and had been following the actions of Winstion for a long time.
He sets up a trap for poor Winston and his love Julia...