Here's how to download iMovie iOS on iOS 12:
1. If you have downloaded it before, go to the App Store and the "Today" tab, then go to your account and to "Purchased". Find "iMovie" in the list of app and download
2. If you have NOT downloaded it before, you need to either get someone who HAS downloaded it to sign in to your iPhone or iPad using their Apple ID and then download it to your device, OR you can log in to an iOS 13 compatible device using your Apple ID, download iMovie there, then return to your iOS 12 device and you will be able to download the latest version (version 2.3.7) to your older device