search results in custom template search.php

The search.php template is used, and the correct posts returned, when a search is performed with the ?s= query. Not ?search=. Make sure the name attribute of the input in your search form is s:

<input type="search" name="s">

And your index.php file should absolutely not be using a custom query like that. Use the main loop the same way you have in search.php. WordPress already queries the correct posts for you.

if ( have_posts() ){
    while ( have_posts() ) {
        the_post();
    }
}