He died as a human, not as God. Because he is both human and divine, his body died but not his soul.
The same belief applies to the rest of us: Our lasting identities are our souls which live forever
even after our bodies stop working.
The "dead know nothing" is only applying to what's left on earth...I mean, in the same verse it
mentions that the dead "have no further reward" but we believe that we will be rewarded because
Jesus died for our sins and opened up access to heaven for us.
So yes, if he remained on earth, Jesus would not have "known" anything. But he was raised from the
dead and is now alive in heaven.