This works for me: ie, I got hello when I pretended to be Max. It's your code from #2 with the = replaced with == as explained.
(Format tidied up a bit)
String myname = "";
void setup()
{
Serial.begin(9600);
}
void loop() {
Serial.println("Enter your name.");
while (Serial.available() == 0)
{ //Wait for user input
}
myname = Serial.readString();
if (myname == "Max")
{
Serial.println("hello");
}
else
{
Serial.println("wut");
}
}