Though Yhorm has two stages (like many bosses), they aren’t that relevant once you understand the mechanics of the battle. Storm Ruler is the key to everything. You can’t deal real damage without it, and even its regular attacks aren’t of any substantial value.
Instead, you charge the weapon (see the Controlling the Game chapter for details). Wait until the wind around the blade starts to burst with energy. Then, use your charged heavy attack to bring Yhorm the Giant to his knees. It only takes a few swings like that to silence him forever.
That’s the short version.
But Yhorm won’t take this lying down. He’ll still try to rip you in half with his humongous blade. He can destroy the pillars in the room, so you can’t count on them for cover. It’s safer to stand in the open and use dodge to get out of the way at the last minute. Yhorm telegraphs his attacks from across the room, so you always know when one of them is coming.
It’s okay to interrupt your Storm Ruler charging to dodge. In fact, it would be foolish not to. Yhorm has a long recovery time from his attacks, and he’ll be very vulnerable after each one. Don’t rush! This is a quick fight, even if you’re defensive.
With Yhorm dead, you’ve finished with the Profaned Capital (and the entire Irithyll Dungeon section of the game). You should now look into Anor Londo, at the far end of Irithyll. Or, you can start clearing out Lothric Castle, which is discussed in its own chapter.