You can go to 3 places: When raining in the overworld, you can go to Akala island, and then go to lush jungle. After that, there is a chance that a Pokemon will call for help, and castform will appear.
2: When there is any weather condition, you can go to route 17, Tapu village, Haina desert, or Malie desert, it has a chance to appear when a Pokemon calls for help.
3: When it is raining, when a Pokemon calls for help on Exeggutor Island, it has a chance it will appear.
I hope I helped!!