Germany attacked American ships with submarines. The U.S. tried to stay out of the war at first. But in 1917, President Wilson decided to fight.