If you have Tasker, you can do that. Not sure if you are using Wireguard, but that makes it simpler to integrate IMHO with it. With it, you set a condition basically if App XYZ is open then use VPN ABC Otherwise, If app XYZ is not open, then use BCA VPN.