You basically just have to hit anywhere in the field, and then it can go freely outside. However, there isn't that many certain places to hit the home run, as many teams put their fielders and other players in different formations, which makes it harder to hit a home run from the easiest places. Best chances of hitting a home run is if you hit a hard enough (more than 105mph) towards the 2nd or 3rd base, as these players on those positions are much closer, and they have less time to react to the ball compared to the outfielders and shortstops.
There is no fence. If the ball touch the field and go to a river, for example (which can happen at some stadiums), the fielders must go and find the ball no matter what, as they still have chance of getting an out. The batter/runner must run to the 3rd base (or triple) in order to do a home run. Triple is a home run in finnish baseball, and after getting to third base, the runner can score an additional run. The main point is that there is never an automatic homerun, The batters must work for it and run to the third base.
Well, the distance between the home base and first base is about 65 feet. Distance between 1st and 2nd base is 118 feet. Then, distance between third and home base is 188,6 feet. The ball must hit the field, and then it can go outside the field.