How use routing mark with 2 wan

I don’t believe in copy-pasting examples, understanding what you are doing and why is much better.

The role of routing-mark is to choose a routing table. A routing table consists of all routes bearing the same routing-mark. An exception is the default routing table, named “main”, where no routing-mark at all is equivalent to routing-mark=main.

So you have to define your routing tables depending on whether a given type of traffic has to prefer a given WAN, or use that WAN exclusively.

So let’s say you have all 4 cases represented by routing mark names, so you will need 4 routing tables in addition to the main one created dynamically by DHCP client and LTE.

These two items if /ip route configuration branch are generated dynamically:
dst-address=0.0.0.0/0 gateway=wan1.gw.ip distance=1
dst-address=0.0.0.0/0 gateway=wan2.gw.ip distance=2

These you have to add manually:
dst-address=0.0.0.0/0 routing-mark=prefer-wan1 gateway=wan1.gw.ip distance=1
(if WAN 1 is down, no other route with routing-mark=prefer-wan1 is active, so routing reverts to the default routing table where route via gateway=wan1.gw.ip is also inactive so it will use the other one)

dst-address=0.0.0.0/0 routing-mark=prefer-wan2 gateway=wan2.gw.ip distance=1
(same case like above)

dst-address=0.0.0.0/0 routing-mark=use-only-wan1 gateway=wan1.gw.ip distance=1
dst-address=0.0.0.0/0 routing-mark=use-only-wan1 type=blackhole distance=2
dst-address=0.0.0.0/0 routing-mark=use-only-wan2 gateway=wan2.gw.ip distance=1
dst-address=0.0.0.0/0 routing-mark=use-only-wan2 type=blackhole distance=2
(here, the type=blackhole routes prevent packets marked with routing-mark=use-only-wanX from being routed using the default routing table if the route via the proper WAN is down).

There is more to it, you have to prevent traffic towards connected subnets (Mikrotik’s LANs) from getting a routing-mark or “neutralize” the routing mark, look for details here.