external disk – macOS Yosemite does not install

I have an old computer with Yosemite that I can not update but still supports Mojave. I wish to install macOS on an external hard drive, but the use of Mojave generates a ban error. However, when I try to install Yosemite, he asks me the name of the Apple ID user, and when I know it, it does not matter.