To get the more recent (these were updated a few months ago) Installer.
The link below assumes your Mac has an existing system, perhaps Yosemite.
OR has an original DVD installer, such as Snow Leopard 10.6.3+
Installer from link below is used to help download El Cap system from online
Apple servers; you would need to use instructions with detailed methods:
• How to upgrade to OS X El Capitan - Apple Support
https://support.apple.com/en-us/HT206886
And it takes a fair bit of time; may even appear to stall-out for an hour, etc.
So if one is impatient or does not pay critical attention to detail, it may fail.
• How to reinstall macOS from macOS Recovery - Apple Support
https://support.apple.com/en-us/HT204904
The hard drive was "erased". Was it totally wiped, to remove all formatting?
• How to create a bootable installer for macOS - Apple Support
https://support.apple.com/en-us/HT201372
[These instructions ^ (above) could be necessary without any content in
your Mac's hard drive, and without Recovery partition (or vintage DVD)
to make an installer with the El Capitan on it. Though not easy, essential]
Should be 'HFS+ journaled' and that can be done using macOS Utilities..
From macOS Recovery. If totally wiped, would need to go online for that.
See 2nd link, to learn how to access and prepare hard drive for installers.
To start into macOS Recovery to use disk utilty online, would be likely. After
basics have begun to take shape, the file you'd need can be downloaded.
[When you need OS X El Capitan, use this link: Download OS X El Capitan.
This gets file named "InstallMacOSX.dmg" that will download to your Mac.]
With some kind of luck, the recovery partition may still exist in that Mac
and be useful to help get and install the Installer, for El Capitan 10.11.6.
Good luck & happy trails!🌻🐝