As per this article : macOS Sierra: Share your computer’s resources when it’s in sleep
- Choose Apple menu > System Preferences, then click Energy Saver.
- Select any of the available “Wake for…” options, for example, “Wake for Ethernet Network Access.” (Different options are available, depending on how you’re connected.)
When the “Wake for network access” checkbox is selected, your Mac wakes at the following times:
- When a user at another computer accesses your computer’s shared resources.
- At regular intervals so that your Mac can notify other computers on the network that its resources are available.

And display sleep slider should never be zero .
Also as per this article also : macOS Sierra: If you can’t share computer screens
Make sure neither Mac is in sleep mode. If necessary, adjust sleep settings using Energy Saver preferences (choose Apple menu > System Preferences, then click Energy Saver).
You can follow the other steps also in the article , it is not mentioned in your original post by which method are you connecting ( screen sharing ) two Macs on the same wifi network .
Read these articles : macOS Sierra: Set up and use screen sharing
: macOS Sierra: Share your screen using Back to My Mac