In order to buy life insurance on another person you are required to have an insurable interest in that person. meaning, you may suffer some financial hardship if the person were to die, or you rely on that person for financial support.
There does exist insurable interest between spouses, parents and their children, siblings, relatives, and business partners.
If you rely on your boyfriend for financial support, such as, he pays the rent or provides you with money for living expenses, etc., you may be able to buy life insurance on him.
Here's how you can learn more about what is insurable interest and how does it work?