5* is going to have higher base stats. Legendary will have all four substats at level one giving you the opportunity to roll substats all the way to a quad roll.
Like everything in this game it really depends on more than a single factor. With bottom row gear gloves/chest/boots it will almost always be best to use the higher star gear for a much larger base stats value.
Here's my "quick and dirty" rundown on how gear works:
The number of stars (rank) affects how high the artifact's stats can go.
The color (rarity) affects how many substats the gear starts with:
The number of substats matters because of how the upgrade "minigame" (so fun!) works. At gear level 4, 8, 12, and 16, one of two things happens: either an existing substat gets upgraded, or a new substat is added. SUBSTAT UPGRADES ARE BETTER THAN NEW SUBSTATS, AND THE ADVANTAGE OF HIGHER-RARITY GEAR IS THAT IT GETS MORE SUBSTAT UPGRADE CHANCES.
The reason for this is that all level-16 gear has four substats. So common gear doesn't get any substat upgrades at levels 4, 8, 12, and 16; it just gets four new substats. Legendary gear starts out with all of its substats filled, so upgrading it to level 16 gives you four chances to UPGRADE those substats! Wow! (So, to review: grey gets no substat upgrades, green gets one, blue gets two, purple gets three, and gold gets four).
The rarity of gear is, that said, less important than rank. As a general rule, you won't want to keep anything with less than five stars except in special circumstances (e.g. 4-star speed boots or crit rate / damage gloves in an artifact set you don't have a lot of).
The primary stat on gloves, boots, and chestplates is about equal in importance to rank. There will be exceptions, but in general, you want crit dmg or crit rate as the primary stat on gloves, HP% or DEF% as the primary stat on chestplates, and SPD as the primary stat on boots.
Helmets, Shields, and Weapons all have the same primary stats (HP, DEF, and ATK, respectively), so on those ones you have to look for desirable substats. It's good to have a percentile stat in synergy with the primary stat (e.g. HP% on a helmet), but ACC and SPD are the most important stats in general (SPD is a little more important than ACC, because eventually you'll be able to push your ACC up by equipping banners with a primary ACC stat and levelling up the ACC bonuses in the Great Hall).
Generally speaking stars and main stats matter more than rarity. You'll outgrow gear with less than 4* very quickly even if it is legendary. 5* and 6* gear will have much better main stats even if it is common. Try to find gauntlets that have crit rate as the main stat and boots that have speed as the main stat.
Here's my "quick and dirty" rundown on how gear works:
The number of stars (rank) affects how high the artifact's stats can go.
The color (rarity) affects how many substats the gear starts with:
The number of substats matters because of how the upgrade "minigame" (so fun!) works. At gear level 4, 8, 12, and 16, one of two things happens: either an existing substat gets upgraded, or a new substat is added. SUBSTAT UPGRADES ARE BETTER THAN NEW SUBSTATS, AND THE ADVANTAGE OF HIGHER-RARITY GEAR IS THAT IT GETS MORE SUBSTAT UPGRADE CHANCES.
The reason for this is that all level-16 gear has four substats. So common gear doesn't get any substat upgrades at levels 4, 8, 12, and 16; it just gets four new substats. Legendary gear starts out with all of its substats filled, so upgrading it to level 16 gives you four chances to UPGRADE those substats! Wow! (So, to review: grey gets no substat upgrades, green gets one, blue gets two, purple gets three, and gold gets four).
The rarity of gear is, that said, less important than rank. As a general rule, you won't want to keep anything with less than five stars except in special circumstances (e.g. 4-star speed boots or crit rate / damage gloves in an artifact set you don't have a lot of).
The primary stat on gloves, boots, and chestplates is about equal in importance to rank. There will be exceptions, but in general, you want crit dmg or crit rate as the primary stat on gloves, HP% or DEF% as the primary stat on chestplates, and SPD as the primary stat on boots.
Helmets, Shields, and Weapons all have the same primary stats (HP, DEF, and ATK, respectively), so on those ones you have to look for desirable substats. It's good to have a percentile stat in synergy with the primary stat (e.g. HP% on a helmet), but ACC and SPD are the most important stats in general (SPD is a little more important than ACC, because eventually you'll be able to push your ACC up by equipping banners with a primary ACC stat and levelling up the ACC bonuses in the Great Hall).
Some good info and bad info here :)
Gloves: HP%/DEF% are best for all but your damage dealers where CD%is best but you will use CR% early game until you have decent gear to get with substats. A few champs you will use CR% (again only until you can get 100 with substats usually) for skill needs (Alure, Armiger, ...)
Chest: ACC/RES also good. Only "bad" ones are flat atk/hp/def. Though exceptions will be made for 6* epic/leg with good substats (speed/speed)
Boots: 95% Speed
Some good info and bad info here :)
Gloves: HP%/DEF% are best for all but your damage dealers where CD%is best but you will use CR% early game until you have decent gear to get with substats. A few champs you will use CR% (again only until you can get 100 with substats usually) for skill needs (Alure, Armiger, ...)
Chest: ACC/RES also good. Only "bad" ones are flat atk/hp/def. Though exceptions will be made for 6* epic/leg with good substats (speed/speed)
Boots: 95% Speed
Liked. But also: HOW DARE YOU!? :)