Making an under maintenance page (without using plugins)

Add this to your header.php file.

if(!is_user_logged_in()) {
    wp_die('This site is currently undergoing maintenance.');
}

You can replace This site is currently undergoing maintenance. with whatever message you want to show.