2 ISPs serving as backup of each-other traffic

Hello.

Please, how may I configure routerOS with 2 WAN and 2 LAN interfaces that member of X IP range on LAN 1 to access internet via ISP1 connected on WAN1 interface and member of Y IP range on LAN 2 to access internet via ISP2 connected on WAN2 interface.
2 WAN interfaces:
WAN 1–>ISP1
WAN 2–>ISP2

and 2 LAN interfaces:

LAN 1–>IP range X
LAN 2–>IP range Y

And each connection of 2 ISPs to serve as backup of other in case one connection will go down.

Thank you for your help.
Mikroitk.JPG