If you're young and you buy, you could get roommates and have them pay rent. That would definitely tilt the benefits heavily to buying.
If you have your first job and therefore little to no liquid cash, and then on top of that you require tenants to make your mortgage, you're in a pretty risky position.
That means that if just about anything goes wrong you can be absolutely fucked.