If your course fulfills the requirements for sharing it with the public, but you would like to hide certain activites or topics from guest users, you can easily do that.
1) Turn on editing mode
2) Go to the settings of the topic or activity you want to hide
3) Go to Restrict access and add a restriction
4) Add a role
5) Select student and optionally click on the eye-icon to completely hide the element (otherwise, guests will see a message that this element is not available and will not be able to open it)
If you have any questions or problems, please contact Moodle-Support.