If you don’t have the required operating system to run Logic Pro 10.5, because you are on El Capitan, Sierra or High Sierra, but would still like to purchase Logic, you can purchase it using a computer that is running the OS that Logic Pro requires, in this case, Mojave or Catalina (the App Store will not let you buy Logic from a computer that is not running the required operating system). You can then go back to the computer where you want to install it, and download Logic from the “Purchases” in your App Store. By doing this, you will be able to download a version of Logic that runs with your operating system (not the current version of course). For example, you will be able to download Logic version 10.4.8 if you are on High Sierra.
So to summarize:
Log in with your Apple ID using a computer running Mojave or Catalina and purchase Logic Pro X. You don’t need to download it or install it
Go back to the computer where you want to install Logic, making sure you log in with the same Apple ID you used to purchase it
Go to Applications > App Store > Purchased and download Logic from here. You should be able to download the last compatible version of Logic Pro available for your operating system by doing this