In short, you can't install too older Xcode versions on the current MacOS versions, you can only install the most recent Xcode versions.
But you need Xcode 8 (and I think it runs on El Capitan).
There is a good solution:
Considering you must use an older Xcode which cannot be installed on your current system (I have the same situation, which you posted the Xcode Swift3 message) , the easier solution is to install an older MacOS version inside a Virtual Machine on your current macOS, and install the older Xcode on it.
Eg: If you use Mojave, create a virtual machine of El Capitan and install the older Xcode 8 on it. Use it to compile or migrate [if possible] your code to current/newer Xcode syntax, or keep working on it using the older Xcode directly inside the VM on your current MacOS Mojave machine.
How to do it:
You can do it with VM Ware Fusion for MacOS. The good news is that Apple MacOS license permits you to create any VM and reinstall older MacOS/OSX versions inside the current version, and use both the older and the current simultaneously.
You can download any older official MacOS version installations freely from Apple Support, and install the downloaded DMG image right on VMWare, very easy.
Here is the Apple Support download link for MacOS installs, scroll down the page and click "load more results" button until you find the needed MacOS version (Sierra, El capitan, whatever).
https://support.apple.com/en_US/downloads/macos
VMWare Fusion for MacOS is also free, you can download it here:
https://my.vmware.com/web/vmware/details?downloadGroup=FUS-1111&productId=798&rPId=35313
After downloading, use the MacOS Install DMG on VMware Fusion (which has a wizard and installs the system just by dragging the DMG install file on it)
Since it is a virtual machine, your current Mojave System will remain intact, and El Capitan will run on it like if it was any normal Application. (this is not dual boot, the VM runs like any application on your desktop).
Considering you will choose El Capitan, after installation is completed, go through the normal Xcode installation process inside it, because it will get the correct and corresponding Xcode version for it from Apple. You can download Xcode via the AppStore icon of the El Capitan Virtual Machine.
Thats all.