Which versions of Xcode are supported on my Mac?
In general, the latest versions of Xcode will only work on the latest version of macOS. If you are unable to install the latest version of Xcode, you may not be running the latest major version of macOS.
To determine if your Mac server can run the latest version of macOS, please see this article: Which versions of macOS are supported on my Mac?
To determine which version of macOS you need to run in order to run a specific version of Xcode, please see this Apple page (scroll down): https://developer.apple.com/support/xcode/
To view all available Xcode downloads, see this download page (AppleID login required): https://developer.apple.com/download/all/?q=xcode
Recent Xcode releases:
For a full listing of macOS/Xcode compatibility and Xcode releases, please see https://xcodereleases.com/