The first thing you should know about the Troll that guards Stormgate in Elden Ring is that you don’t have to fight it. If you’ve been following the golden rays from Site of Grace to Site of Grace, then the Site of Grace in front of Stormgate will be your third, and you will have therefore encountered Melina and accepted her gift of the Spectral Steed Whistle. This is Elden Ring’s way of hinting that you should use the Whistle right away, and ride through Stormgate at high speed, ignoring the Troll and the guards.
But if you don’t take the hint, you just really hate Trolls, or if you’re a bit of a masochist, then you can try to beat the Stormgate Troll, and it is possible to do so without levelling up a lot. There’s a Lordsworn’s Greatsword in the caravan by the road, which is useful against the Troll as there’s no point having a shield in your left hand. Go far enough into Stormgate to attract the Troll’s attention, then run back out again, weaving from side to side to dodge the incoming arrows. Once you’ve drawn the Troll outside, lock onto its upper body and keep backing away along the slope to the left of the gate.
With most of Troll’s attacks, the best thing to do is dodge them by rolling back or to the side. Closing in for an attack of your own is usually quite risky. However, when it does a stamp then punch combo, that’s your chance. Roll to one side just after it does the stamp, and you should dodge the punch. Then, while it’s recovering, do a jump attack, then immediately roll to a safe distance. Sometimes these attacks won’t do much damage, but if you hit the Troll in the face, it’ll take heavy damage, and might even collapse to the ground, allowing you to get a lot of strikes in without it fighting back. These jump attacks are generally more effective if you can lure the troll down the slope, then get above it and attack from higher ground. The Stamp (Upward Cut) skill can also be quite effective in this battle, but it’s slow and a little hard to pull off effectively.
When the Troll draws its sword, its attacks change, but your strategy remains basically the same. Keep your distance, dodge a lot, and move in for jump attacks whenever it lunges forward and stays low for a little while. Be patient and methodical, and you’ll beat it eventually.