In Pokémon Ruby version, the Waterfall move is taught by HM07 (a hidden machine). HM07 is found in the Cave of Origin, which is located in Sootopolis City.
In order to reach the Cave of Origin (and HM07), you must play through most of the storyline, which includes obtaining the first seven gym badges and confronting Team Magma in the Seafloor Cavern, triggering a drought that spreads across Hoenn. Once you have done so, travel with the Red Orb to Sootopolis to gain access to the Cave of Origin. At the cave, defeat Groudon to restore the weather to its normal condition. Once you have defeated him, you will find HM07 after you go through the second ladder. In order to use Waterfall outside of battle, you must obtain the Rain Badge from Wallace, the Sootipolis City gym leader.