Ok, based on your provided code, it looks like you manually created this Navbar rather then using the Navbar Component from the Bootstrap app this forum is for.
The code provided has some missing element to it so I am going to provide for you a remake using the apps Navbar using some of your stuff. The main thing is that you can use media queries to adjust things like the max-width you have set for the DIV around the search input. If you move the inline styling to a CSS file you can use media queries to alter that max-width for the screen size you need so that it doesn't put the search input on a separate line.
Here is your working HTML that you can either use or compare to your existing HTML to see what you have missing.
If by chance you are using the app, it's better that you work as much as possible with how the app wants you to work with such as drag/drop and available components rather then brute force with Custom Code on large components. In the end you get a better understanding of the how to code things a little nicer and how to work around things to get them to come out like you want.
The "*" are in the HTML for the sole purpose of the forum not munching the HTML code so you will need to take those out.