On my S7 the WiFi is disconnected once the phone goes to AOD(Always On Display). My Droid Maxx never did that, it was always connected to whatever WiFi that was available. Is this common for the S7 phones?
Do you have your wifi sleep policy set to "Never" in the advanced wifi options?
How do you know it's disconnecting? Is there a Wifi icon on the AOD, or do you get a notification that it's reconnected each time you turn the screen fully on?