Profile only works for logged in users
https://docs.civicrm.org/user/en/latest/organising-your-data/profiles/ has all the details you should need:


  Visibility: If the Profile is being used for a searchable directory, set the Visibility of any fields you want to include on the search form to Public Pages or Public Pages and Listings. For fields that will be used on sign-up forms, set Visibility to User and User Admin only. This ensures that other visitors to the form can't view any data from the database. To use fields for Search Views, you must set Visibility to Public Pages or Public Pages and Listings. Choosing either of the Public Page options pops up two additional settings: