"In order to make a Legendary Pokemon appear, players around the world will need to capture a certain number of monsters during the event's Challenge Windows. If the players at the event are able to defeat the Legendary Pokemon, it will begin appearing worldwide. Based on the recent live-action trailer that Niantic released, it appears Legendary Pokemon will be fought the same way as standard Raid Battles, so players will need to cooperate to whittle away its health and defeat it."
As it turns out, Team Mystic won that event and now Articuno and Lugia are available ever where. It seems you're able to get one by doing the new "raid" battles, but I haven't even messed with gyms yet, so I haven't tried raids. I thought I read that you could get lucky and get an egg from a gym and it hatches into a legendary. I also believe I read that you cannot leave a legendary Pokemon at a Gym.
Anyway...Go Team Mystic!!!!!! (That's my team!)