I thought they were allies at the beginning of the war. They both invaded Poland at the same time right?
They did not fight each other when they invaded Poland. The USSR invaded the east while Germany invaded the west, south and north in 1939. The Soviets and Germans had agreed to divide all of Eastern Europe, which included Poland; the western third of the country was to go to Germany and the eastern two thirds to the Soviet Union.