You cannot do it using iTunes Home Sharing, if you want to sync an iPod from the Mac that is accessing the shared library. Song files need to be stored locally on the computer syncing to the iPod.
If you want the two iTunes libraries to be (momentarily) the same, you can use the procedure to backup and restore the iTunes library
Manage and back up your iTunes media library - Apple Support
To do this, one of the iTunes libraries needs to be the master already, meaning you put it as is on the other Mac (replacing that other Mac's iTunes library). This procedure does not "merge" two separate iTunes libraries into one.
To summarize the procedure, the first step (after Find the iTunes Media folder) is to Consolidate your iTunes library data into the iTunes folder. Your iTunes folder is in your user account Music folder. If you are using the default settings in iTunes, all of your iTunes data may already be in your iTunes folder. Then, Back up your library and media files by copying your iTunes folder to an external drive. The last step is to Restore your library from a backup, which in this case is to the other Mac. You are basically replacing the existing iTunes folder on that Mac with the master iTunes folder from the backup.
NOTE: If you can set up File Sharing between the two Macs, you can copy the iTunes folder directly between the two Macs, with no external drive. However, depending on network connection speed and size of your iTunes folder, using an external drive may be a lot faster.
After the transfer completes, when you run iTunes, it uses that master iTunes folder and, at that moment, the iTunes libraries on the two Macs are exactly the same. But they will drift apart over time, unless you have iTunes Match to keep them "in sync."