This quote is an example of Martin Luther’s masterful exegetical skills. He could study a passage and wring it dry. Few have been gifted as this man was when it comes to the interpretation of Scripture. Especially earlier on he was prone to the allegorical method of interpretation that had been current in the church for centuries, but he broke free of that more and more as time went on.
This quote also demonstrates how much doctrine Scripture can convey with a single passage, if we have eyes to see. Here Luther derives Christ’s death and resurrection both from a passage that, at first glance, seems to speak of neither. Yet this is right and proper, for Jesus Himself said, “These are the Scriptures that testify about Me.” (john 5.39)  Scripture is a massive unit, a rich storehouse of treasures, and everything in it connects in a unified and harmonious whole. There’s always more to study in Scripture!
Here, he’s commenting on Genesis 49:10:
Therefore, it is the kingdom of Christ which is here described in masterly fashion, namely, that before him many should wield the scepter of Judah until he should come himself and take it in his own hands forever, and that he would have no successor, nor would there ever be another king of the tribe of Judah. Thereby it is made clear that his kingdom would be a spiritual kingdom, following upon the temporal kingdom; for no person can have an eternal kingdom who is himself mortal and reigns temporally. Therefore, the scepter of Judah did indeed endure from David down to shiloh as something temporal, having a succession of mortal kings. But now that shiloh is come, the scepter remains forever in the hands of one person; no longer does it involve a succession of kings.
From this it necessarily follows that this shiloh must first die, and thereafter rise again from the dead. For since he is to come from the tribe of Judah [Gen. 49:10], he must be a true, natural man, mortal like all the children of Judah. On the other hand, because he is to be a special king, distinguished above all who have held the scepter of Judah before him, and he alone is to reign forever, he cannot be a mortal man, but must be an immortal man. Therefore, he must through death put off this mortal life, and by his resurrection take on immortal life, in order that he may fulfil this prophecy and become a shiloh to whom all the world shall be gathered. He is to be a truly living man, a king of the tribe of Judah, and yet immortal, eternal, and invisible, ruling spiritually in faith.

Luther, M. (1999, c1962). Vol. 45: Luther’s works, vol. 45 : The Christian in Society II (J. J. Pelikan, H. C. Oswald & H. T. Lehmann, Ed.). Luther’s Works (45:III-217). Philadelphia: Fortress Press.