Try first to turn on iCloud Photos in the Photos Preferences.
You can only use iCloud Photos, if you have a Photos Library designated as the System Photos Library, and the System Photos Library is located on a compatible volume, that is always available.
- Launch Photos, if it is not running.
- If Photos is not opening with the Photos Library you want to use for iCloud Photos, quit Photos again, then hold down the options key ⌥ while launching Photos and select your main library from the library chooser panel.
- In the Photos > Preferences > General look at the option "Use as System Photos Library". If it is not greyed out, click "Use as System Photos Library" to make this library the System Photos Library.
- Now you should be able to enable iCloud Photos for this library in Photos > Preferences > iCloud.
- Then look again at the System Preferences > AppleID > iCloud Photos.
If you cannot make the Photos Library to your System Photos Library, check the location of the library. If it is on an external volume, the external volume should be prepared as described here: Move your Photos library to save space on your Mac - Apple Support