How to Create a Bootable MAC OS X El Capitan USB Flash Drive
First download OS El Capitan from the App Store
After its downloaded, insert your usb drive and format it (Mac OS Extended (Journaled)) using the Disk Utility. Remember to name your new volume as elcapitan
Then, open the Terminal and type:
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/elcapitan --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction
Now connect your Installation usb drive on to your new computer and boot from elcapitan.
That’s it.