First, you have to remember that the word (משיח) doesn't mean "messiah." It means "anointed one" and is used for ANYONE who was anointed with oil. The Tanakh talks about a Jew of "proven" Davdic descent. Here is a good source for what Jews hold by in terms of this matter.
The word "messiah" in English is only used by Jews who are using the English vanicular, even if it doesn't match the actual Hebrew. That being said, see the following translation below of the Mishnah Torah where Rabbi Mosheh ben-Maimon explains how we Jews know what will happen to bring about the return of the Torah based kindom of Israel. (Again, note that the below is a translation and there are some elements of it that would need to tweeking if one wants to really understand what is written in Hebrew. Yet, for the sake of time this will work for you.)
Mishnah Torah - Hilchoth Melakhim 1: 1-
Israel was commanded to fulfill three mitzvot upon entering the Promised Land:
a) To choose a king, as Deuteronomy 17:15 states: 'Appoint a king over yourselves;'
b) To wipe out the descendents of Amalek, as Deuteronomy 25:19 states: 'Erase the memory of Amalek;'
c) To build God's Chosen House, as Deuteronomy 12:5 states: 'Seek out His Presence and go there.'
The appointment of a king should precede the war against Amalek. This is evident from Samuel's charge to King Saul (I Samuel 15: l-3): 'God sent me to anoint you as king ... Now, go and smite Amalek.'
Amalek's seed should be annihilated before the construction of the Temple, as II Samuel 7:1-2 states: 'And it came to pass, when the king dwelled in his palace, and God gave him peace from all his enemies who surrounded him, the king said to Nathan, the prophet: 'Look! I am dwelling in a house of cedar, ... but the ark of God dwells within curtains.'
Since it is a mitzvah to appoint a king, why was God displeased with the people's request of a king from Samuel? Because they made their request in a spirit of complaint. Rather than seeking to fulfill the mitzvah of appointing a king, they were simply intent on rejecting the Prophet Samuel as implied by God's reply to him (I Samuel 8:7): 'It is not you, but Me they have rejected.'
A king is not intially appointed except by a court of 70 elders, together with a prophet, as Joshua was appointed by Moses and his court, and as Saul and David, were appointed by Samuel of Ramah and his court.
When a king is appointed, he is anointed with oil reserved for this purpose, as I Samuel 10:1 states: 'And Samuel took the cruse of oil and poured it over his head. Then, he kissed him.'
Once a king is anointed, he and his descendents are granted the monarchy until eternity, for the monarchy is passed down by inheritance, as Deuteronomy 17:20 states 'Thus, he the king and his descendents will prolong their reign in the midst of Israel.'
If the king leaves only a young son, the monarchy should be held for him until he matures, as Yehoyada did for Yoash. The order of inheritance of the monarchy is the same as that governing the inheritance of property. An older son is given precedence over a younger one.
Not only the monarchy, but all other positions of authority and appointments in Israel, are transferred to one's children and grandchildren as inheritances forever.
The above applies if the knowledge and the fear of God of the son is equivalent to that of his ancestors. If his fear of God is equivalent to theirs but not his knowledge, he should be granted his father's position and given instruction. However, under no circumstance should a person who lacks the fear of God be appointed to any posi-tion in Israel, even though he possesses much knowledge.
Once David was anointed king, he acquired the crown of kingship. Afterwards, the kingship belonged to him and to his male descendents forever, as II Samuel 7: 16 states: 'Your throne shall be established forever.' Nevertheless, his acquisition of the monarchy was conditional, applying only to the righteous among his descendents, as Psalms 132:12 states: 'If your children will keep My covenant... their children shall also sit on your throne forever.'
Despite this condition, God assured David that the monarchy would never be taken from his descendents forever, as Psalms 89:31-38 states: "lf his children will forsake My Torah and cease walking in My statutes ... I will punish their transgressions with the rod and their sins with plagues. Nevertheless, I will not utterly remove My grace from him.... His throne shall be ... established forever.'
Mishnah Torah - Hilchoth Melakhim 12
In the future, the Messianic king will arise and renew the Davidic dynasty, restoring it to its initial sovereignty. He will build the Temple and gather the dispersed of Israel.
Then, in his days, the observance of all the statutes will return to their previous state. We will offer sacrifices, observe the Sabbatical and Jubilee years according to all their particulars as described by the Torah.
Anyone who does not believe in him or does not await his coming, denies not only the statements of the other prophets, but those of the Torah and Moses, our teacher. The Torah testified to his coming, as Deuteronomy 30:3-5 states:
God will bring back your captivity and have mercy upon you. He will again gather you from among the nations... Even if your Diaspora is at the ends of the heavens, God will gather you up from there... and bring you to the land....
These explicit words of the Torah include all the statements made by all the prophets.
Reference to Mashiach is also made in the portion of Bilaam who prophesies about two anointed kings: the first anointed king, David, who saved Israel from her oppressors; and the final anointed king who will arise from his descendants and save Israel in the end of days. That passage Numbers 24:17-18 relates:
'I see it, but not now' - This refers to David;
'I perceive it, but not in the near future;" - This refers to the Messianic king;
'A star shall go forth from Jacob' - This refers to David;
'and a staff shall arise in Israel' - This refers to the Messianic king;
'crushing all of Moab's princes' - This refers to David as II Samuel 8:2 relates: 'He smote Moab and measured them with a line;'
'decimating all of Seth's descendants' - This refers to the Messianic king about whom Zechariah 9:10 prophesies: 'He will rule from sea to sea.'
'Edom will be demolished' - This refers to David as II Samuel 8:6 states 'Edom became the servants of David;'
'Seir will be destroyed' - this refers to the Messianic king as Ovadiah 1:21 prophesies: 'Saviors will ascend Mount Zion to judge the mountain of Esau....'
Similarly, with regard to the cities of refuge, Deuteronomy 19:8-9 states: 'When God will expand your borders... you must add three more cities.' This command was never fulfilled. Surely, God did not give this command in vain. There is no need to cite proofs from the works of the prophets for all their books are filled with mention of this matter.
One should not presume that the Messianic king must work miracles and wonders, bring about new phenomena in the world, resurrect the dead, or perform other similar deeds. This is definitely not true. Proof can be brought from the fact that Rabbi Akiva, one of the greater Sages of the Mishnah, was one of the supporters of King Bar Kozibah and would describe him as the Messianic king. He and all the Sages of his generation considered him to be the Messianic king until he was killed because of sins. Once he was killed, they realized that he was not the Mashiach. The Sages did not ask him for any signs or wonders. The main thrust of the matter is: This Torah, its statutes and its laws, are everlasting. We may not add to them or detract from them.
If a king will arise from the House of David who diligently contemplates the Torah and observes its mitzvot as prescribed by the Written Law and the Oral Law as David, his ancestor, will compel all of Israel to walk in (the way of the Torah) and rectify the breaches in its observance, and fight the wars of God, we may, with assurance, consider him Mashiach.
If he succeeds in the above, builds the Temple in its place, and gathers the dispersed of Israel, he is definitely the Mashiach.
He will then improve the entire world, motivating all the nations to serve God together, as Tzephaniah 3:9 states: 'I will transform the peoples to a purer language that they all will call upon the name of God and serve Him with one purpose.'
If he did not succeed to this degree or was killed, he surely is not the redeemer promised by the Torah. Rather, he should be considered as all the other proper and complete kings of the Davidic dynasty who died. God caused him to arise only to test the many, as Daniel 11:35 states: 'And some of the wise men will stumble, to try them, to refine, and to clarify until the appointed time, because the set time is in the future.'
Jesus of Nazareth who aspired to be the Mashiach and was executed by the court was also alluded to in Daniel's prophecies, as ibid. 11:14 states: 'The vulgar among your people shall exalt themselves in an attempt to fulfill the vision, but they shall stumble.'
Can there be a greater stumbling block than Christianity? All the prophets spoke of Mashiach as the redeemer of Israel and their savior who would gather their dispersed and strengthen their observance of the mitzvot. In contrast, Christianity caused the Jews to be slain by the sword, their remnants to be scattered and humbled, the Torah to be altered, and the majority of the world to err and serve a god other than the Lord.
Nevertheless, the intent of the Creator of the world is not within the power of man to comprehend, for His ways are not our ways, nor are His thoughts, our thoughts. Ultimately, all the deeds of Jesus of Nazareth and that Ishmaelite who arose after him will only serve to prepare the way for Mashiach's coming and the improvement of the entire world, motivating the nations to serve God together as Tzephaniah 3:9 states: 'I will transform the peoples to a purer language that they all will call upon the name of God and serve Him with one purpose.'
How will this come about? The entire world has already become filled with the mention of Mashiach, Torah, and mitzvot. These matters have been spread to the furthermost islands to many stubborn-hearted nations. They discuss these matters and the mitzvot of the Torah, saying: 'These mitzvot were true, but were already negated in the present age and are not applicable for all time.'
Others say: 'Implied in the mitzvot are hidden concepts that can not be understood simply. The Mashiach has already come and revealed those hidden truths.' When the true Messianic king will arise and prove successful, his position becoming exalted and uplifted, they will all return and realize that their ancestors endowed them with a false heritage and their prophets and ancestors caused them to err.