Capitalism, Communism, and Socialism are three different political and economic models. Let us try to understand them one by one.
Capitalism revolves around private property. In a capitalist society, individuals own the resources that are required to produce goods and provide services. Individuals can hire workers and can keep the profit for themselves. It is the individuals who decide how much supply needs to be produced based on demand. There is a competition between many individuals who generate the same product. Ideally, this keeps the selling price in check. This kind of system is called an open market. The government does not regulate anything in such a society.
Philosopher Karl Marx believed that the capitalist model created an unfair society where the rich would get richer and the poor would get poorer. So, in opposition to the capitalist model, he proposed a socialist model. In a socialist society, it is the government who owns the resources and operates production. Individuals work for the government and earn a wage. Everyone is given what they require to live a normal life by the government. Ideally, this should create an equal and just society which has eliminated social class completely.
Marx believed that a successful socialist model would naturally lead to communism being introduced. The workers would take ownership of what the government previously owned and share it equally among themselves. All the resources would belong to the community and there would be no need for a government. A classless and stateless society would remain. In its idealist form, communism has never been able to successfully materialize.
So, this was all about Capitalism, Communism, and Socialism. In the world today, no country follows a single ideology. Countries and governments adopt certain features of certain models which best suit their needs. Even the most capitalist countries which allow for a relatively free market, have governments who tax the citizens and use that money for socialist endeavours like public-funded schools or transport. Pure capitalism or pure socialism do not exist. We have different combinations of the two models.