Installing Mojave on External Drive from Yosemite?
Make a USB installer by following this tutorial.  I would recommend the terminal method as that's the one I have tried and found reliable.  After you have made the installer, boot to it and plug in the external drive that you wan't Mojave installed on (which I'll refer to as the Mojave drive from now on).  Format the Mojave drive as APFS and GUID partition map with Disk Utility.  Finally, install macOS on the Mojave drive.