User blog comment:FairyRaven/Fairy Tail Chapter 325: Unity, Review and Commentary/@comment-7418318-20130330082422/@comment-7418318-20130330171831

He did have 7 years to learn how to figure out the gate so he might have learned by trial an error, or he might have found one of the people who build the thing and learned it from that person.

The more interresting question for me is, how did he know that it was Lucy who closed the door. The present Rogue is on the central square, so he can't witness whatever is happening inside the castle himself.

I think the source of both information (Lucy and the gate operation) might have come from someone who tried, and apparently succeded, to manipulate Rogue into killing Lucy in the past for some sinster reason.