The DNS for subdomain.domaina.com will need to be in the DNS tab at Cloudflare (pointing to anything) and . You’ll need to add a record for each subdomain you want to redirect, as wildcard records can’t be .
Then you can create a Page rule for domaina at so:
Matching url *.domaina.com/*
Settings:
Forwarding URL - 301 redirect
Enter the value as https://$1.domainb.com/$2.