As you mentioned in the comments, if what works best for you is displaying different header files based on whether a user is logged in or not, this is the best way to achieve it:
if( is_user_logged_in() ) :
/** This is the name of your second header file.
* It assumes the 'header-' and the '.php' portions.
* So the following get_header would use this file 'header-loggedin.php'. */
get_header( 'loggedin' );
else :
/* This would use the default header for your child theme named 'header.php'. */
get_header();
endif;
Now if all that's different is the navigation, then what I'd do is just make two different navigation locations in the header and load them conditionally based on whether a user is logged in or not. Then, in the Menu Admin area in WP you have the ability to manage two different menus and simply assign one as 'main logged in' and 'main not logged in' or something like that.
The best solution really just depends on how many different aspects of the header you actually need. If it's just the nav, then I'd go with conditional menu locations. If it's more than just the nav, I'd go with conditional header loading.
Here's how you create two menu locations, add this to your functions.php:
register_nav_menus(
array(
/* Make sure you change the textdomain to match yor child themes. */
'header-loggedin' => esc_html__( 'Main Menu Logged In', 'tetdomain' ),
'header-loggedout' => esc_html__( 'Main Menu Logged Out', 'textdomain' )
)
);
That creates two new menu locations that you can assign a menu to in the WP Appearances -> Menus screen.
Next, if going with a single header.php
file, you place the following code where your navigation is supposed to appear:
if( is_user_logged_in() ) :
wp_nav_menu(
array(
'theme_location' => 'header-loggedin',
'menu_id' => 'header_loggedin'
)
);
else :
wp_nav_menu(
array(
'theme_location' => 'header-loggedout',
'menu_id' => 'header_loggedout'
)
);
endif;
As you can see, it uses the same is_user_logged_in()
check and then simply establishes which 'menu location' should be used based on the result of the condition.
wp_nav_menu has lots of configurable options as well, so look into that in case you want to customize containers, etc.