Header Elements don’t accept PHP, and trying to turn the default woo search form to a shortcode is a nightmare, probably because Woo add it to their premium extensions.
You could use the Widget Shortcodes plugin to generate a shortcode.
Or maybe one of the other search plugins, like this one with Ajax Search: