Well two of my best friends at uni don't live on campus. When I was living on campus in my first year, sometimes we'd go back to mine, or we'd do work in the library or go to the SU, hang out, go shopping, have lunch...They're both on the same course and I think we became good friends because we were together in 2 out of 3 of our module classes. It worked out well because we were free/busy at the same time so could do things together. Sad as it is, we often did homework together instead of doing it at home on our own.
Your best bet is to find people in your classes so that you're free at the same time. Most people will be in the same boat when you first start your classes/lectures because they won't know (or will know few) people in their classes/lectures. Take the opportunity to get to know lots of people and see if there are any people that you share more than one class with!