Complex sentence: Ganon's first appearance takes place before the events of the game, after the Ocarina of Time when Ganon was banished to the Sacred Realm to stand trial before the Sages.
Split into simpler sentences: Ganon's first appearance takes place before the events. Of the game, after the Ocarina of Time when Ganon was banished to the Sacred Realm to stand trial before the Sages.