Based on the information provided, you qualify for the physical presence test for 2024 since you were physically present in foreign countries for 337 days, which exceeds the required 330 days.
However, you do not qualify for the bona fide resident test for 2024 because you changed your residence from Chile to Sweden during the tax year. The bona fide residence test requires you be a resident of a single country for an uninterrupted period that includes an entire tax year.
You should proceed with claiming the foreign earned income exclusion using the physical presence test as your qualification method.
For more information see:
- Physical presence test
- Bona fide residence test