That depends on what your goals are and what equipment you feel you need. If you want access to a wide variety of machines and enjoy being in a public setting for motivation, then joining a gym would most likely be best. If you prefer to train privately or like to train at odd hours, then it's probably a good idea to invest in a home gym so you can train whenever you like.