Apple apparently still makes El Capitan available for those whose much-older Macs can't install a more recent OS version, so I suppose it *might* be possible to get an ElCapitan-compatable version of GarageBand as well, though you'd probably have to contact Apple directly. I would think that'd be a better option than trying to locate a copy from sources where you're never sure what you're getting..
https://support.apple.com/en-us/HT206886
Another possibility that some people claim has worked for them—if your computer is unable to upgrade to an OS version later than El Capitan, and you try to download GB from the Apple Store, you *might* (I say *might*) get a message directing you to an older compatible GB version; but if your Mac *is* capable of being upgraded to a newer OS (& newer GB) then that'll probably be the only option Apple will offer you..