To answer that question, let's reel back to the 1800s in England, where young men all over the country were playing some version of soccer. Each school tweaked the rules a little bit: some, like Rugby School, allowed the use of hands whereas others, like Eton College, restricted movements to the legs only.
The world's first Football Association (football, as in American soccer) was formed in London in 1863. Its purpose was to set standard rules for the game. Aptly enough, they issued two codes for the two different versions of the game. The one you play with the use of hands was to be called "rugby football" after Rugby School, and the version with no hands was to be called "association football," after the Football Association itself.
Now, did you know the word soccer was born from slang? Young British people would often use a word, shorten it, and add an -er suffix at the end. For example, breakfast became brekker, rugby became rugger, and football became footer. Naturally, association became soccer, as they also omitted the first two letters. That leaves us with a game called soccer football, which is then easily shortened to just soccer.
That settles the story of the game referred to as soccer by the Americans. But what about the game Americans call football? This game is based on rugby and was pretty widespread in the USA by the time association football (soccer) took off there. The reason it's called football is pretty obvious: you use your foot to hit the ball. The other reason is that it is based on rugby, which was named by the English Football Association, "rugby football."
The term American football was first recorded in the 1870s. Up until 1974, the governing body for soccer in the US was called the United States Soccer Football Association.
You may be surprised to know that the Americans are not alone. Canadians, Australians, and New Zealanders use the term soccer in the same way Americans do. But the really interesting thing is, the British also used the term soccer until not that long ago. In fact, the two terms - soccer and football - were almost interchangeable between 1906 and 1980. They were both used to describe the game Americans call soccer. As Americans used the word soccer more and more, the Brits used it less and less.