Have you ever downloaded/ installed Xcode before using your AppleID.
If so open the App Store, sign in and open the Purchased page.
If you see Xcode click on the Download button.
It will say that the latest version requires 11.3 but does give you the opportunity
to download the older version which can be used in macOS Sierra.
If that does not work you can go to the Apple Developer website and if you
are not already registered you can do so, it is free.
From there you can navigate to older versions of Xcode and download
the version compatible with macOS Sierra.
https://developer.apple.com/download/all/
The page is very long and you may have to click on View More
to see further versions of Xcode, I think you are looking for 9.2 or 9.3.
It may be possible to upgrade your Mac to a newer OS if you are interested.
The App Store Updates page only informs you of updates available for the OS you are running.
Which OS you can upgrade to will be governed by which model and year your mac is.
Click on the top left of your screen click on About This Mac to find out the year of your mac.
If you find your mac can upgrade to the newer OS's like macOS Mojave 10.14, macOS Catalina 10.15,
macOs Big Sur 11.6 or the latest macOS Monterey 12.0 I would recommend you upgrade to
macOS High Sierra 10.13 first.
For High Sierra, Mojave, Catalina or Big Sur,
Open Safari and click on this link,
How to get older versions of macOS
Go to Check Compatibility to see if your mac qualifies for the OS upgrade you want.
Then go to the Use Safari to download macOS section and click on the OS you want to install.
Before upgrading make a full back up of your Mac.
Check that third party apps you use have updates available for the new OS.
https://roaringapps.com
Check that your printers/ scanners etc have updated drivers and software available for the new OS.
Connect your mac to your router via cable rather than rely on WiFi.
Do not use your mac while it is downloading
and do not use any other devices that share the same internet connection.
If the App Store says ‘Open’ then it is detecting a previous download of the install app
go to the Applications folder locate Install macOS ******.app.
Move it to the Trash, empty the Trash.
Restart, click on the link again, the App Store should say ‘Get' or 'Download'.
If you want to or are able to upgrade to Monterey open Safari and click on the link below,
How to upgrade to macOS Monterey – Apple Support (UK)
If you are considering upgrading to Catalina, Big Sur or Monterey be warned they do not support 32bit apps.
Your Mac is probably running 32bit apps and these will need to be updated to 64bit apps,
some updates may be free, some may be paid. Use this free app to discover which apps you have
are 32bit, https://www.stclairsoft.com/Go64/ then contact the developers of the software to see
if they are offering 64bit updates.