Out in the wild? It's just random.. Good luck getting one, the chances of getting one are, I think, 1 out of 8192. Luckily for me, I found a shiny Tentacool in Pokemon Emerald, when I was Surfing the waters..
Well, if あなた want a shiny legendary, I hear あなた can save before the fight and keep restarting. I think for legendaries, there's a higher shiny rate! :) Guess what shinies I have!... None! But my little sis found a yellow geodude! :)
Really just random, bro got a bacwards colored Torchic on Ruby and a red insted of green Snover on his Dimond version, I got a shiny Tenticool (now Tenticrule on Battle Revolution) on Platnum, a shiny Poochyena that stayed ゴールド on Emrald, brown Machop on 火災, 火 red, green Doduo on my first run at Leafgreen, reverse Medditite (and if あなた dk what it means, red Meddite, blue Medicham) and a green Espion on Pearl
There's is approximately a 1% chance that あなた will find one out in the wild randomly. I have only found one shiny exeggcute but my bro has had a sableye, girafarig, slugma, spearow and horsea. o_O