Hi @Kelly10. This is already the behavior we follow for the "public" communities. If the "Access" of the community is "Public", it means that non-logged-in users can see your community posts. But as soon as they want to do an activity (post, comment, like, follow, join,...), the system will ask them to login or sign-up.
Where to change the access to "public"? Admin Settings> Access> change the Access to Public> Save changes.