How to remove the header from all pages except home?

In the line before <header id="header">, put this code:

<?php if( is_home() ) : ?>

After the </header> tag that closes #header (which isn’t included in your code), put this code:

<?php endif; ?>

The is_home() is called a “template tag” and there are quite a few of them. If your site uses a static front page set on Settings > Reading, then replace is_home() with is_front_page().