Ash's Goomy was caught near Hiyoku City in the Kalos Region. It literally fell on
Ash Ketchum's head while he was walking in a rocky area after it dropped from the sky from the Swanna it had hitched a ride on.
Ash's Goomy is quick to take offense and as it is a Dragon Type Pokémon, it doesn't like Fairy Type Pokémon like
Clemont's Dedenne.
The habitat that Goomy was living in was invaded by a bunch of Pokémon and it escaped as a flock of Swanna fled the area. While on the Swanna,
Ash's Goomy got dehydrated. After consulting the dex,
Ash Ketchum realized that Goomy like to live in damp, shady places, so its slimy body doesn't dry out. It took Goomy to a nearby river to rehydrate.
Team Rocket captured it and
Ash's Pikachu but it was mainly
Ash's Goomy that allowed them to get away and fend them off. It made
Ash's Pikachu's fur coat slick enough to get through the cage and during Team Rocket's attack, it Bided its time and sent the group flying away.
Ash Ketchum realized that it wasn't a weak Pokémon at all like the Dex said and he could feel its strong willpower. He asked it if it wanted to become as strong as Pikachu and to join him on his journey and it agreed to become part of the team.
Ash's Goomy evolved into
Ash's Sliggoo during a battle against a wild Grumpig that was bullying a bunch of Spoink after
Ash Ketchum tried to intervene in the battle to protect Goomy.