How to upgrade to OS X Yosemite – Apple Support
Go to Section 4 and click on Download OS X Yosemite.
This downloads InstallMacOSX.dmg to your Downloads folder.
The next section can only be done on a mac that is capable of running Yosemite,
a mac that came preinstalled with an OS later than Yosemite will refuse to do the next bit.
When downloaded open to InstallMacOSX.pkg, double-click on
that and an installation window will open, this does not install Yosemite
but converts the InstallMacOSX.pkg to the Install OS X Yosemite.app which
you will find in your Applications folder, it should be 5.73GBs in size.
(If the installation window asks which disk you want to install to, you must pick
the disk that you are booted to at the time. Not any internal or external disk that
you want to eventually install Yosemite on, that is for later.)
To start the installation of Yosemite double click on the Install OS X Yosemite.app.
If you want to create a bootable USB installer you can use this free app.
https://macdaddy.io/install-disk-creator/