SSL is nothing but a protocol which provides communication security over internet (network). SSL is responsible to encrypt the segments at Application Layer using asymmetric cryptography for an exchange of key, message authenticity codes for message integrity & symmetric encryption for confidentiality.
SSL is host based & is always installed on a domain, sub domain. SSL is never issued OR installed on an IP address.
If you generate a CSR on domain with www (www.milesweb.com), it will be applicable on domain with and without www (https://www.milesweb.com & https://milesweb.com). This does not includes any other sub domains other than the root domain. Alternatively, if you want every sub domain to be protected, you can opt for a Wild Card SSL certificate.