It is sometimes said that God is a God of wrath in the OT but a God of love in the NT. This of course is not true, even if it is not difficult to see where the idea comes from. God is both said to be gracious and compassionate in the OT and is wrathful in the NT.
It would probably be fair to say that in the bulk of the OT, God loves Israel but is not particularly "loving" toward its enemies. Nevertheless, there are also hints of a broader view, such as we find in Jonah, Ruth, and legislation that is favorable toward the stranger in the land. And of course God's love for Israel does not keep Him from judgment either of individuals in it or of the nation as a whole. Judgment is not unloving in itself.
In Genesis, Noah found favor in God's eyes, but we find no mention of love for those who die in the Flood. God is sorry that He made humanity, which might indicate a hope to love all humanity (Gen. 6:6). God chooses and calls Abraham, and He is willing to show mercy on Sodom and Gomorrah if even ten righteous people can be found. But He does not find ten, and the cities are destroyed. His willingness to spare a large number for the sake of a few, however, seems to point toward a merciful dimension to God's character even though He has favorites.
In the rest of the OT, we find more than one perspective on those outside of Israel. On the one hand, Deuteronomy 7:7 indicates that God loves Israel and chose Israel in preference to all the other nations of the earth. God promises to defend Israel against them (7:19). Yet God also tells Israel "Do not deprive the alien or the orphan of justice... remember you were slaves in Egypt" (Deut. 24:17-18). The alien is also given from the tithe of produce collected in the third year (Deut. 26:12). These comments assume that there will be non-Israelites living with Israel, and it puts them in the category of the orphan and widow.
Other parts of the OT assume a completely hostile stance toward those outside of Israel. In Joshua, God rebukes Israel for letting the Gibeonites deceive them to get mercy, even though they apparently mean Israel no harm (Josh. 9). Conquered cities like Jericho and Ai are to be whole burnt offerings in which even infants and animals must not be spared. In Ezra, the Israelite males are forced to divorce the foreign wives they have married and put away the children of those marriages (Ezra 9-10). No regard is given for whether these women might be willing to join Israel's covenant. In these instances there seems little room for anyone outside Israel to be favored by God.
This attitude seems in significant tension with that of Ruth, where a Moabitess is free to join Israel. Also, the very point of Jonah's moral failure derives from an attitude toward Nineveh similar to that Joshua and Ezra espouse toward non-Israelities. Of course what is most striking in Jonah is that Nineveh is the nation that will destroy the northern kingdom. Its author could hardly not have known this fact. God is willing to have mercy on one of Israel's most bitter enemies.
Jonah is the point of the OT most on trajectory to the NT. It contrasts interestingly with Nahum's stance toward Nineveh: "The LORD has given a command concerning you, Ninevah: 'You will have no descendants to bear your name'" (Nahum 1:14). Psalm 137:9 similarly expresses that "blessed is the one who takes your [Babylon] babies and dashes them against the rocks." But for Jonah, "you are gracious and compassionate, slow to anger and full of mercy, and you change your mind about sending evil" (4:2). Nahum also says that God is "slow to anger" (Nahum 1:3), but does not mention the possibility that God might change his mind if Nineveh repents.
2 Maccabees 7 has a very interesting perspective on the way God deals with the sins of Israel as opposed to the sins of other nations. With the other nations, Maccabees proposes, God stores up his wrath until it has reached a certain point where He entirely consumes the foreign people. But with Israel, He punishes them as they go along and so never completely destroys them. Here God's love for Israel is shown even in the way God punishes them, in contrast to the way He punishes other nations with total annihilation.
It is of course in the NT that we get a more consistent picture of God as loving toward all humanity, not only Israel. And God's love is shown not just toward those who love Him by keeping His commandments, but also on the prodigal and on the sinner. There is mercy for the intentional sinner as well as for the unintentional one.
The OT of course has instances of forgiveness for intentional sin. David sins with Bathsheba and with numbering the children of Israel. In both cases he is able to find "atonement" and reconciliation with God. But Numbers 15 "officially" provides atonement only for unintentional sins. The sacrificial system is not meant to provide for so called "sins with a high hand."
Yet one of the hallmarks of Jesus' earthly ministry is his reclamation of the "lost sheep of Israel," those who were lost to the covenant: prostitutes, toll collectors, etc. Jesus never affirms the sins of such individuals, but he makes it clear that God wants to reclaim them. This love for the lost, for the condemned, extends in the NT beyond the lost sheep of Israel to the lost of the world.
Further, this love for the sinners of the world is cosmic in scope. "For God so loved the world that He gave his only begotten Son, that whoever believes on him will not perish, but have everlasting life" (John 3:16). Note that the comment is that God loved the world and sent His Son for our sake because He loved us. He is not said to send the Son because He loved Himself or for His own sake. Also, there is not sense here of Jesus coming for the elect. The impression is that Jesus truly came for all.
Romans 5:7-8 similarly points out how phenomenal God's love for His enemies is. Some might give their life for a good person, but God demonstrates His love for "us" in that while we were still sinners, Christ died for the ungodly, for His enemies. The implication is that God loves even His enemies.
Matthew 5:43-48 explicitly implies the same. There is no honor in loving only those who love you. God is "perfect," "complete" in this regard. He sends rain both on the just who love Him and on the unjust who don't. Since rain falls on everyone, it is clear that God loves even those who never respond positively to His gracious offering. We are likewise called to go the rest of the way and be complete as our Father in heaven is complete.
1 John 4:7-8 tell us that God is love and that Christians are to love one another because God is love. This is, of course, not a literal statement, as if you could put God's "cells" or "atoms" under a microscope and declare, "Hey, what do you know, God literally is love." This is a metonymy indicating that love is so associated with God and how God behaves that we can metaphorically say that God is love.
If omnipotence, omniscience, and omnipotence then tell us what God can do, love tells us what He will do. Love implies a number of other associated terms that depict how God acts. God is merciful, which means that He does not always insist that we experiences the consequences of our actions. God is gracious, which means that He is inclined to give us what we could never earn. He is slow to anger, which means that He does not necessarily administer justice to us when we deserve it--He gives us time to repent. And it is not just the elect, not just the friends of God who God treats this way. He shows His love for the whole world by treating His enemies this way as well.