I had to do a reinstall of my 2013 MacBook Pro and the stock installer would give me the old one which I would then need to upgrade to El Capitan. In computer world I prefer clean installs over upgrades as it always leaves residue from the older OS so I did it with USB drive and wrote it down below.
My USB drive was from a Linux install and OSX could not make heads or tails from it with GUI tools. But luckily OSX has command line tool diskutil that can.
This is simplest done with diskutil. Let's first look at what drive the USB is.
diskutil list
Then reformat the entire disk for install use this command, replacing diskN with the disk you see above as your USB drive:
diskutil eraseDisk JHFS+ ElCapInstall diskN
Once El Capitan has downloaded from Apple store make an install media with below command:
cd /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources sudo ./createinstallmedia --volume /Volumes/ElCapInstaller --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction
Reboot computer with command
sudo reboot
And hold option (alt) key while restarting. Select El Capitan installer media and the rest should be self explanatory.