After you download the InstallOSX.dmg you then go two more processes to get the Install OS X Yosemite.app
which you use to install Mac OS X Yosemite 10.10.5 or create the bootable USB installer.
Open your Safari browser and click on the link below,
How to get old versions of macOS – Apple Support
Go to Download macOS and click on OS X Yosemite 10.10
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.
(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.
The copy of the install app self deletes after installing Yosemite, 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 Yosemite.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 Yosemite.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
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume --applicationpath /Applications/Install\ OS\ X\ Yosemite.app