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 you want a shiny legendary, I hear you 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 gold on Emrald, brown Machop on fogo red, green Doduo on my first run at Leafgreen, reverse Medditite (and if you dk what it means, red Meddite, blue Medicham) and a green Espion on Pearl