A red line means that there is not a customer with this name in the system. In this case, you would first check the spelling -- if the name is spelled wrong, then it won't match. Try reducing the number of letters you type to just the first part of the name, if you are not sure how the whole is spelled. Of course, the red line could also mean that the customer just hasn't been entered into the system yet. In this case, you would click the button to the right of the Customer name field and select "New Company...", which will give you the entry form to create the company in the system.
The Green underline means that there are multiple possible matches to what you typed. This is very common with customers that have branch locations -- each branch entry usually starts with the same name and then ends with the location. If you see the green underline, right-click on it and select the correct customer from the drop-down list. If there are more than a dozen or so possible matches, then you will see the "Open Contact Selector" choice in the menu, which will open all the results in an easier to browse dialog. The next time you go to enter a branch location where you have multiple matches and the green underline, enter the part of the name that is different than the other branches. For example, for "ABC Distribution Oakland" and "ABC Distribution Sacramento", enter "ABC Oak" to get the exact match for the Oakland branch.
Besides right-clicking on the underlined names, another way to do the same thing is to use the button on the right-side of the Customer name field. In addition to the "New Company..." selection to create a new entry, there is the "Find" option which will open up the Contact Selector dialog and allow for searching and browsing existing entries.