How do i hide all comments from logged out users

I would recommend looking for all occurrences of comments_template in your theme and wrapping them in a is_user_logged_in condiational.

Example:

<?php
if (is_user_logged_in()) {
    comments_template();
}

Alternatively, you can open up your theme’s comments.php (or the equivalent, it’s usually comments.php) and add something like this at the very top:

<?php
if (!is_user_logged_in()) {
    return;
}

PHP let’s you return out of files early, so you can “bail” from an include like the above. If you need to remove comments on ALL post types for non-logged in users, the second option is likely the best. If you need it conditionally on some post types, the first is the best.

The best solution, however, is to use your own filters. Rather than calling is_user_logged_in directly, call apply_filters with a unique name and return try by default.

<?php
// somewhere before all the other stuff in comments.php
if (!apply_filters('wpse96406_show_comments', true)) {
    return;
}

Then in functions.php, hook into your own filter and modify how it behaves.

<?php
add_filter('wpse96406_show_comments', 'is_user_logged_in');

Why do this? Much more flexible.

Want to show comments on certain posts? The first two options above don’t let you do that (without some refactoring). Using your own filter makes things much more extensible for your future self — or for end users if you’re releasing the theme.