Financial disparity between me and my boyfriend

Hey guys. I am lucky in that I come from quite a privileged background and while not mega wealthy my parents have saved some money for me and allowed me to keep all the money I've earned and not have to contribute to household bills.

My boyfriend however does not and so has much less savings than me. I have about 20k saved for a deposit on a flat He has a good job now and is also saving (although he earns less than me). We would like to live together soon but I am thinking about buying. I am not very educated about these matters but can I buy a place and have him live there while he saves up ? Is he entitled to some of the flat where we to break up ? Can be pay me some rent ?