That is not possible.
Photos cannot store it's library on any sort of network or cloud storage. If you want the library off your mac, the only compatible way is with a locally connected external volume, directly connected (thunderbolt or USB) and formatted APFS, or MacOS extended. Also the volume cannot also be used for time machine.
See
https://support.apple.com/en-gb/HT201517
The only other way to use iCloud is to turn on "optimise mac storage". This will then store full size originals only in iCloud, and reduced the size of your library by 80 to 90%. The problem with this is then how you manage backups, since you don't have local copies of the files on your mac.