First of all have you prepared your external disk properly.
Open Disk Utility,
in the left hand side panel chose the external section
and the Disk not any indented Volume
Click Erase,
give the Disk a name,
Format: Mac OS Extended (Journaled)
Scheme: GUID Partition Map
click Erase
After your Disk has been reformatted it is now ready to receive the installation of an OS.
Try the installation again.
And just to ask did you go through the procedure to download InstallMacOSX.dmg
open it to InstallMacOSX.pkg.
Open that so you see an installation window, which does not install El Capitan
but creates Install OS X El Capitan.app to your Applications folder on your internal drive.
With Install OS X El Capitan.app in your Application folder you can use that to install
El Capitan.
The copy of the install app self deletes after installing El Capitan, so make sure you keep a copy of the InstallMacOSX.dmg
if you need it in future, or you could just make a copy of the Install OS X El Capitan.app prior to installing and moving it to
an external drive for safe keeping. It is also possible to create a bootable USB installer disk, using the Install OS X El Capitan.app
in the Applications folder, and the createinstallmedia command in the Terminal app. Read the instructions here,
How to create a bootable installer for macOS – Apple Support