KitKat had the Settings > WiFi > Advanced WiFi option to set the priority as shown.
This isn't present on my Nexus Lollipop and Marshmallow devices. I see there is an App available, but I'd like to know if there is some onboard way I missed to manage these, and if not, what the thinking was behind its removal.
This works on my CyanogenMOD 13 device, which I have come to believe should work on Lollipop and Marshmellow devices as well:
In your Wi-Fi settings, tap the overflow icon, select "Saved networks". Tap the overflow icon again, disable "Automatic priority". You can now re-order your networks by dragging the signal icon up or down.
Let me know how/if it works for L & M!