Most CA's will issue either a MultiDomain SSL or a single Wildcard cert.
So you would need (2) Certs to cover those 3 domains.
1) example.com, www.example.com
2) app.example.com, *.app.example.com
staging.app.example.com is covered by *.app.example.com
but user.staging.app.example.com is not.
I've suggested using -
hyphens instead in some cases, such as user-staging.app.example.com
I say most, as you can request these from Digicert and some others.
Cert 1 Generation with OpenSSL)
openssl req -new -newkey rsa:2048 -nodes -sha256 -keyout example.com.key -subj "/C=US/ST=Virginia/O=Company Name/OU=Web Security/CN=example.com" -config <(
cat <<-EOF
[req]
default_bits = 2048
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
[ req_ext ]
subjectAltName = @alt_names
[alt_names]
DNS.1 = example.com
DNS.2 = www.example.com
EOF
)
Cert 2 Generation with OpenSSL)
openssl req -new -newkey rsa:2048 -nodes -sha256 -keyout example.com.key -subj "/C=US/ST=Virginia/O=Company Name/OU=Web Security/CN=example.com" -config <(
cat <<-EOF
[req]
default_bits = 2048
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
[ req_ext ]
subjectAltName = @alt_names
[alt_names]
DNS.1 = app.example.com
DNS.2 = *.app.example.com
EOF
)