If a Photos Library is on an external volume, the drive with the volume needs a wired connection. The Photos Library must not be on a network volume.
You could share your system Photos Library on an external volume between two Macs, if you prepare the external drive as described here: Move your Photos library to save space on your Mac - Apple Support
You must be able to set the "ignore ownership on this volume" flag, or you will continually have to repair the library because of ownership conflicts. The biggest problem will be, that the System Photos Library has to be available for the background processes, as soon as you are signed into your user account. So you will continually have to sign out of your user account, when you want to dismount the external drive to connect it to your other Mac. And you have to run the same system version on both Macs.
It would be much more convenient to share your Photos Library in iCloud. Use two separate external drives to host the local copy of the library, one for each Mac. Sync the changes to the Photos Library between the two Macs with iCloud Photos.