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