As a general rule, you’re absolutely right – person is used to refer to an individual, and the plural form is people. As you have said, we can also use peoples to talk about different groups within a nation or the world. For example:
The peoples of the world must unite to tackle climate change.
The peoples of India include Hindus, Muslims and Sikhs.
However, in both these cases, it would also be correct to use the regular plural people instead of peoples, as in:
The people of the world must unite to tackle climate change.
The people of India include Hindus, Muslims and Sikhs.
In fact, I think that the word peoples is considered slightly old-fashioned and isn’t used as much these days except in formal documents or speeches. Similarly, persons is considered to be quite formal and isn’t used often in day to day language. Here are a couple of examples of when it might be used:
We will be happy to accommodate up to four persons in each room.
This is an example of formal language that may be included in the terms and conditions of a contract or agreement, in this case to do with a hotel.
I was approached by a group of persons unknown to myself.
This is quite an old style of English and you rarely hear this spoken these days.
Interestingly, I noticed when I was working in India that the word persons was used much more regularly than in the UK and this may well be the case for other countries where English is widely spoken.
To complicate matters even further, people can also be used as a singular noun! Look at this example:
The Canadians are a people who enjoy nature and spending time outside.
This is really the only time that you would use it as a singular form though, when you are referring to the citizens of a particular state or country. So basically, both person and people can be used as singular nouns, people can be used as a plural noun and persons and peoples are also acceptable plural forms. I would say that these days, using people as a singular noun and both peoples and persons are fairly uncommon and do sound quite formal.
I hope this helps with your query and that you don’t despair too much with the complexities of the English language!