The solution for me based on systemd-resolved behavior was to implement the rules like this:
iptables -t mangle -A OUTPUT ! -s 127.0.0.1 -j MARK --set-mark 2
iptables -t nat -A POSTROUTING -m mark --mark 0x2 -j MASQUERADE
Please read the comments. Thanks for all the help especially from A.B. and Luciano Andress Martini.
$ iptables -t mangle -A OUTPUT ! -s 127.0.0.1 -j MARK --set-mark 2 $ iptables -t nat -A POSTROUTING -m mark --mark 0x2 -j MASQUERADE