Legends are a higher rarity than epic gear and to increase chances of legends appearing, you can have luck to increase rarity of the loot before legends. Also item drops increases overall drops and that can also increase how many legends drop.
Magic enemies are more likely to drop higher rarity drops than normal enemies and same goes for rare and epic enemies. Legend enemies guarantee a legend drop and mythic enemies guarantee 3 legend drops or so with 1 Eternal. Higher floors can mean a chance to unlock more legends into the codex that you can craft with dust and just be able to use as well as experiencing different affixes and sets. Although the more expensive route to get a legend you wanted and not climb floors very high is farming dust which involves salvaging lots of legends in lower floors like floor 200 or less. From 101. It does seem that any higher than floor 200, items drop less from enemies so the rate of legends decreases.
Anyway its not the end of the story. Eternal legends are another type of legend which are a bit rarer but they are green, have 50% Item quality which doubles affix values and you can convert them into ultra rare crystals. Also the affixes on it cannot be removed but you can add a mythstone on an empty socket and with Eternals that can have mythics, you can manually add epic affixes using Topaz on it. Main reason to convert eternals is that many of them you may not use and it can be converted into a lot of ultra rare crystals that you can make a powerful customisable build with. To increase chances of finding one , you can use Eternalized set and Treasured perk from ascension and with luck and item drops increasing legend drops for a further increase in eternal drops.
Crystal legends , another type of legend to find. They have crystal affixes on naturally dropped legends that can save you an obsidian crystal for your build and they appear Cyan. You can Aldo create one manually technically. To increase the chances of them, you can use crystalline set affix and treasured perk from ascension and it works well with item drops+ luck on legends.
Then there's legend Pets, eternal pets, legend maps and eternal maps. They come from enslaver, cartographer from a feat and kill 200/150 enslaver feat and other enslaver feats. They are affected by luck and Eternalized but they don't need item drops and its not always guaranteed they drop the legend pets and eternal pets (though legend maps always happen through feats but eternal maps are a chance ).
However I'm not exactly sure how a legend is computed and scored such as the exact % or how the RNG works to the exact level in maths but that's not necessary.