How is the location of the world series decided

World series is played at the 2 home fields of the winning teams(not like Super Bowl). Home field advantage is given to the league that won the All star game.