The Future Perfect connects two events. The event that will happen first is shown by adding will have -ed to the verb, and the event that will happen after that is shown by using the Future Simple, like this,Originally Posted by Aroma
1st Event: I will complete my work. => I will have completed my work
2nd Event: Max will visit me. => Max visits me.
I will have completed my work (1st event) by the time Max visits me (2nd event) tomorrow.
In your example sentence 2), shown below, the 2nd event has been left out of the sentence:
2) I will have completed my work by [the time Max visits me] tomorrow.