Germany was a small country compared to the Soviets or the Americans, so he thought of the best word in the world "Sharing" So he signed a pact with Russia to split Poland and to not hit each other. Next he wanted to take over France and Britain and then turn and then take over Russia, and then they would eat Pfefferpotthast(last part was a joke :) )
The best answer is A) Hitler wanted to prevent a two-front war.
Hitler and Stalin never viewed each other as allies but as huge potential inconveniences to one another that they wanted to avoid in the near term. Hitler's plan to dominate Europe involved an incredibly overwhelming demonstration of military force on the Western Front, rolling quickly through France and with the ultimate aim of dominating the UK as well. The prospect of US involvement in the war and the stubborn strength of the UK made Hitler nervous about a whole additional front to push against the enormous country of Russia (then the USSR).
Stalin also wanted to avoid war as it built up its military capabilities, and was seeking to try to take some weaker countries as well. Ultimately, this desire for some German-invaded territory as part of an ultimate peace deal is what made Hitler decide to just invade Russia as well.