Usually within your first year, you will have been allocated other students to live with at your halls of residence. If you get on with them, these could be people that you may choose to live with when you move into private student accommodation. However, if some of these people are noisy and messy and have given you reason to complain, perhaps they wouldn't be the best to share with again. Bear in mind that if you do choose the existing people you already live with for your second year, you will end up living with them for two whole years - so think very carefully!
You could also look to people on your courses you have made friends with, but again, think very carefully about this as without living with them, you won't really know how you will get on under one roof.
If you want to take the hassle out of deciding, you could just book a room in a private hall block and they will put you in a flat with other like-minded students. You can always request single-sex flats, students in your same year, and some even take in consideration your similar interests. Or if sharing isn't really your thing, you can rent studio flats as well - there's many types of student accommodation to choose from!
Before committing to living with a group of people, consider how their actions may affect you (and how yours may affect other people!). You can still be friends with people without living with them if you think that being flatmates will be detrimental to your friendship. Things to consider would be: