How to use Tasker to close app on exit
After hours of researching I am pleased to inform you that I have found a way to clear the recent apps lists in Tasker

Prerequisites:


Autoinput plugin
Root


Open tasker and head to Task tab: You can name it Clear recent apps


A1: AutoInput Global Action [ Configuration:Action: Recent Apps Timeout (Seconds):20 ]
A2: Task Wait Value: 250 MS
A3: Code → Run shell → Command input tap 405.3 1198.5 and use root ( this is the x,y co-oordinates of the point on screen which will be simulated by a tap event - my device is 720x1280.
You can obtain  your x,y coordinates by enabling show pointer location/cursor position in developer options )
A4: AutoInput Global Action [ Configuration:Action: Home Timeout (Seconds):20 ]
A5: Flash [ Text:Apps cleared Long:Off ] (You may need this flash notification to know what took place)


Now for the profile;


Go to Profiles tab and choose Application (The list of "secure apps" )
Now for entry task just create Task Wait action and choose any waiting period e.g. 2 seconds
For the exit task choose the previously created task ( Clear recent apps)


Note: Try not to test this profile when Tasker is running in foreground/included in recent apps because it may crash or go into a loop. But once the profile is set it runs smoothly as required. 

Credits:


how to create close recent app list
Tasker: clear recent apps command