Indeed, beyond the final destination of the trip, if the flight stops at an airport in the US, the passenger must have a visa or travel permit that allows him to transit through that country.
You need a transit visa
Hello, for any stopover in the USA you need an American Visa
Hello, if you make a stop, you do not require a visa, since you are simply in transit and the passengers that their destination is Miami get off, then the other group of passengers who will make their journey to the final destination enter.
As far as it is necessary to have an American VISA even when you are in transit
Ask your airline for advice
Thanks! Your answer is awaiting moderation.