Bodybuilding is done in two forms. First form is the one in which you prepare yourself for professional bodybuilding to become a professional wrestler who competes in various competitions. Second form is that in which you just try to maintain yourself by having a comparatively good physique through bodybuilding exercises and weightlifting. So it is important to determine first that which type of bodybuilding are you actually looking for? If you are looking for professional bodybuilding, then definitely you need to go to the gym but if you are looking for fitness and good physique, then you may do it at home as well but still gym would be preferable. Below is a bit of comparison between the two in term of performing exercises:
1- At home: home could be a good place to get a taste of bodybuilding. You can start at home to get yourself familiar to the exercise a bit and buy some cheap dumbbells with which you can perform variety of exercises. But obviously at home you have too many shortcomings like you would be short of equipment, you would not have a proper trainer to guide you, you would be missing social aspect and you would of course not be getting any tips about your nutrition and food intake. So home is a good option only for taking a start and a bit of warm up before you actually join gym. It cannot be taken as a permanent option for bodybuilding because proper facilities would not be available.
2- At Gym: Gym is definitely a proper place for bodybuilding because you have so many facilities available at each step to get proper body. You have variety of equipment available, you have trainer available who can guide you about your workouts and your food intake, you have proper environment that encourages you for bodybuilding and promotes a healthy competition, you get a food shop where you can get meals and supplements etc. So you must join a gym and make sure that you get maximum benefit out of it. Especially the ones who are looking to get professionally trained and win competitions, they must ensure regular visit of gyms.