If you have the plus or pro plan you can install the exit intent addon. With this addon you can have messages appear when a user indicates they are about to leave your site. A user indicates they are about to exit your website when they move their mouse cursor above the top of the website.
To make a message only appear when a user appears to be exiting the website you need to go to the general tab in message settings interface, select auto style message then select the exit intent checkbox.
Note: Exit intent is only available for auto style messages