After you get the Master Sword and cut the barrier around Hyrule Castle, you have to rescue Princess Zelda.
Inside Hyrule Castle 1F
Go north to the next room. You have to defeat the ball and chain soldier to continue. Sometimes the soldier throws the ball directly at you, so be prepared to use your shield. Run up and hit the soldier when the ball is swinging away from you.
In the next room, get past the soldiers to go up the stairs. You'll pass through 2F on your way up the stairs. Use the north door to reach 3F.
Inside Hyrule Castle 3F
In this room, avoid fighting on the stairs, because your sword might not be on the same level as the enemies that you're trying to hit. You have to kill all of the soldiers in this room, so go up the stairs and merge with the wall to reach the red soldier on the ledge on the right. Go through the door after you have killed all of the soldiers.
In the next room, go toward the east door. The door will close and a bunch of armos will wake up and attack. Kill all of them to reopen the door. Go through.
Go west and up the stairs to go through the next door.
Inside Hyrule Castle 4F
You discover Zelda confronting Yuga, telling him to stop kidnapping people. Yuga already has all seven Sages. He turns Zelda into a painting, summons some soldiers, and runs away.
Defeat the soldiers and go up the stairs and use the door on the right to reach the next floor.
Inside Hyrule Castle 5F
Defeat the soldiers in this area and go south up the stairs. Use the door in the south wall to go outside. There are some recovery hearts hidden on the wall under the door that you come out of. Go west and into the door there. Get past the enemies and use the northwest door.
Inside Hyrule Castle 6F
Get past the soldiers to go east and through the southeast door. Go north to reach the next door. Back inside, go through the north door to get to the next floor.
Inside Hyrule Castle 7F
Go through either of the southern doors to go outside. Once there, go up the stairs and through the north door to reach the next floor.
Inside Hyrule Castle 8F
Yuga is in front of a colorful wall, and the painting of Zelda is above it. He is about to leave Hyrule, but he wants to get rid of you before he goes.
Yuga splits into three and moves around the walls as a painting. Hit any of the Yugas to hurt him. Be sure not to stand in the path of any of the Yugas because he will shoot lightning down the corridors that he can see. After you hit him a few times, he gets angry and creates some soldiers to attack you. Once the soldiers are gone, you have to hit the correct Yuga to hurt him. If you hit the wrong one, it turns into a soldier. You have to kill it before Yuga will come out again. The enemy soldiers give recovery hearts sometimes. After you hit the correct Yuga, he leaves through the north door. Go through.
Follow the path to a large door to the west. In this room, you can get recovery hearts in the walls. There is a tapestry in the north wall that has some evil darkness coming out from behind it. Cut the tapestry to discover a colorful crack in the wall. Merge with the wall and go into the crack. When you come out, you're in a room much like the one you left, but there is a storm outside and the room is a mess. Things look very different in the map, too. Go outside and follow the path to a north door into the castle.
You find Yuga surrounded by the paintings of the Sages. Now you know who the rest of the Sages are. Watch the cutscene. You end up in the Blacksmith's House. Your task now is to find the paintings of the Sages, but you won't be able to reach every area of Lorule. You will have to find a way back to Hyrule then return to Lorule in order to get to all of the locations.
Your map now has a button that lets you compare your location in Hyrule with the corresponding location in Lorule.
Go to where your house would be in Hyrule. There is a crack in the wall there that you can use to go back to Hyrule. Whenever you use a warp point from Lorule to Hyrule, that point gets added to the map. Use the one near your house to find Sahasrahla.