Article snapshot taken from Wikipedia with creative commons attribution-sharealike license.
Give it a read and then ask your questions in the chat.
We can research this topic together.
For the team competitions, the best ranked NOC in each of the five continental championships, with the exception of the host country Brazil which represented the Pan American continent, obtained a secured place for the Games, while the remaining NOCs battled out for the three highest-ranked spots at the Olympic Qualification Tournament. For the duet, the best ranked NOC in each of the five continental championships that did not have a qualified team assured a secured spot, while the other eleven top-ranked NOCs were selected through Olympic Qualification Tournament. All eight NOCs that had already qualified in the team event must each automatically selected two synchronized swimmers to form a duet.