“…Jesus said unto him,…. Directly, without taking time to think of it; and though he knew with what design it was put to him, yet, as an answer to it might be useful and instructive to the people, as well as silence and confound his adversaries, he thought fit to give one; and is as follows, being what is expressed in Deuteronomy 6:5.
thou shalt love the Lord thy God with all thy heart, and with all thy soul, and with all thy mind; that is, with all the powers and faculties of the soul, the will, the understanding, and the affections; in the most sincere, upright, and perfect manner, without any dissimulation and hypocrisy, and above all objects whatever, for this the law requires; and which man, in his state of innocence, was capable of, though now fallen, he is utterly unable to perform; so far from it, that without the grace of God, he has no true love at all to God, in his heart, soul and mind, but all the reverse; his carnal mind is enmity against God, and everything that is divine and good, or that belongs unto him: and though this is now the case of man, yet his obligation to love the Lord in this manner is still the same; and when the Spirit of God does produce the grace and fruit of love in his soul, he does love the Lord sincerely; because of the perfections of his nature, and the works of his hands, and because of the blessings of grace bestowed, and especially for Christ, the unspeakable gift of his love; and most affectionately does he love him, when he is most sensible of his everlasting and unchangeable love to him, and when that is shed abroad by the Spirit; “for we love him, because he first loved us”, 1 John 4:19 instead of, “with all thy mind”, as here, in Deuteronomy 6:5 it is read, “with all thy might”; and which clause is here added by the Syriac, Persic, and Ethiopic versions…”

“…commandment. Whether the object of it is considered, who is the first and chief good; or the manner in which it is to be observed, which requires and engrosses the whole heart, soul, and mind, and all the strength and power of man; or its being the principle from whence all the duties, and actions of men should flow, and the end to which all are to be referred; and is not only a compendium of the duties of the first table of the decalogue, but of all others that can be thought to, and do, belong to God. This is the first command in order of nature, time, dignity, and causality; God being the first cause of all things, infinitely above all creatures, and love to him being the source, spring and cause of love to the neighbour; and it is the greatest in its object, nature, manner, and end. That this command, and these words our Lord cites, are so full and comprehensive, the Jews themselves cannot deny…”

“…On these two commandments hang all the law and the prophets. Not that all that is contained in the five books of Moses, and in the books of the prophets, and other writings of the Old Testament, is comprehended in, and is reducible to these two precepts; for there are many things delivered by way of promise, written by way of history, &c. which cannot, by any means, be brought into these two general heads: but that everything respecting duty that is suggested in the law, or is more largely explained and pressed in any of the writings of the prophets, is summarily comprehended in these two sayings: hence love is the fulfilling of the law; see Romans 13:8. The substance of the law is love; and the writings of the prophets, as to the preceptive part of them, are an explanation of the law, and an enlargement upon it: hence the Jews have a saying (c), that “all the prophets stood on Mount Sinai”, and received their prophecies there, because the sum of them, as to the duty part, was then delivered. Beza thinks, that here is an allusion to the “phylacteries”, or frontlets, which hung upon their foreheads and hands, as a memorial of the law. And certain it is, that the first of these commands, and which is said to be the greatest, was written in these phylacteries. Some take the phrase, “on these hang all the law and the prophets”, to be a mere Latinism, but it is really an Hebraism, and often to be met with in the Jewish writings: so Maimonides says (d),
“the knowledge of this matter is an affirmative precept, as it is said, “I am the Lord thy God”; and he that imagines there is another God besides this, transgresses a negative, as it is said, “thou shalt have no other Gods before me”; and he denies the fundamental point, for this is the great foundation, , “on which all hang”:and so the word is used in many other places (e). The sense is plainly this, that all that are in the law and prophets are consistent with, and dependent on these things; and are, as the Persic version renders the word, “comprehended” in them, and cannot be separated from them…”
-John Gill

Link:
http://biblehub.com/commentaries/gill/matthew/22.htm