Those resurrected in Matthew 27:52-53 are called “many” which means many(high in number); multitudinous, plenteous, "much"; "great" in amount (extent).
In Acts 2:29 David was both dead and buried at that time so he wasn’t one of many that were resurrected in Matthew 27:52-53.
How is it then that the “rest of the dead” in Revelation 20 doesn’t include David?
Yes-- many. 144,000 even, according to scripture.
David did die and was buried. And when he died, his spirit-- his "Lord" -the master of his house did not die with that physical body--that "house." The spirit, returned to God.
David died and was buried-- the writer says.... you can go to his sepulcher and look at his bones. But Jesus taught that to be dead physically is not equivalent to our spiritual "life" in fact-- he taught that 'dead physically' is akin to falling asleep-- a temporary state.
He taught--
I am the God of Abraham, and the God of Isaac, and the God of Jacob? God is not the God of the dead, but of the living.
When he said this, Abraham, Issac and Jacob were most assuredly-- dead. In the physical sense. But that isn't what he was talking about.
So too with David. In almost the same breath as he taught this above, he also said concerning David>>>
The LORD said unto my Lord, Sit thou on my right hand, till I make thine enemies thy footstool?
You can read it-- God, said to David.......
David had a Lord. He is quoted in Acts speaking of this Lord, this way>>>
For David speaketh concerning him, I foresaw the Lord always before my face, for he is on my right hand, that I should not be moved:
Therefore did my heart rejoice, and my tongue was glad; moreover also my flesh shall rest in hope: Because thou wilt not leave my soul in hell, neither wilt thou suffer thine Holy One to see corruption. Thou hast made known to me the ways of life; thou shalt make me full of joy with thy countenance.
He recognized the difference between the physical flesh-- the David, that was his body, and the spirit that was within him-- that he had been anointed with, by God.