At first I was thinking mage for obvious reasons. Then it occurred to me that he uses mostly (if not all) support magic. He wears gray/white cloth. So priest. Then I remembered he goes toe to toe with a Balrog using a sword and has a fancy mount. So, paladin maybe?
Edit: I know it’s LOTR and not WOW, but if you had to pick one class that best represents him.
Well in the movies (you said ‘seen’) he seems to revive Pippin with magic. In the books it is debated (but possible) that he used magic to revive Pippin.
You’re approaching this from an entirely wrong perspective.
Gandalf is after all an NPC.
And some NPC:s do have a class they represent while often having powers not available to player character classes.
Many of them are just “undefined” class and I believe Gandalf would best fall under this category. A strong story NPC with a mixed bag of abilities.
But if I had to choose his middle earth form would obviously be a mage.
Thematically he’d be a Druid. Protecting the natural world, buddies with the Eagles and other animals (though not to the extent of Radagast), and all that.
Actually Shaman might be a better choice, especially with the whole “dying and being resurrected” thing.
Tolkien wrote that the Maiar are “spirits whose being also began before the world, of the same order as the Valar but of less degree”
The wizards of Middle-earth were Maiar: spirits of the same order as the Valar, but lesser in power.[1]:389 The first three of these five wizards were known in the Mannish tongues of the Lord of the Rings series as Saruman “man of skill” (Rohirric), Gandalf “elf of the staff” (northern Men), and Radagast “tender of beasts”