Joshua chapter 2 presents itself as an interesting metaphor for the current covenant that believers in Christ are in. The Israelites are sent to conquer Canaan since it was the promised land. They were there to exile and wipe out the corrupt Canaanite culture and live there as a culture that represents God. This was how the old covenant started, but now we are in the New Covenant. In the new covenant, Earth functions as a spiritual Canaan, and the kingdom of God is like a spiritual Israel that will come and conquer this world when Jesus returns.
In Joshua chapter 2, Joshua sends two spies into Jericho, and while there, they met Rahab. Rahab was a prostitute who had heard the story of how God delivered Israel from Egypt and gave them favor in the wilderness, and victory over the Amorites and Amalekites. She made a decision to follow their God and be on their side by protecting these spies when the authorities were looking for them. She hides them on her rooftop and lets them escape down a scarlet rope hanging out of her window. She has them make a promise that they will leave her and her family untouched when they come to conquer the city, and they respond in agreement with this oath as long as she doesn’t rat them out to the authorities and she agrees.
This is a template for Jesus sending out his disciples in the New testament. When believers are hiding from the authorities of Rome and the Jewish Sanhedrin council as they go out and illegally share the Gospel of Jesus Christ, they were hidden by people who wanted to know more about the Messiah (ex. Acts 9:22-25). In Matthew 10:11-15, Jesus said to his disciples when they go into a town to minister, they must stay in the house of one person that entire time. Anyone that welcomes them welcomes Jesus himself and they are to pronounce and keep a blessing over that household, but if those people prove unworthy they can take that blessing away. For those that reject them they are to shake off the dust of their feet and walk away, and in Jesus finishes by saying wicked Sodom and Gomorrah will be better off on Judgment Day than those people.
In our present age, the Earth is our spiritual Canaan filled with cities like Jericho, and there are a bunch of Rahab-type people who are willing to come to the side of the Kingdom of Heaven waiting to make contact. In addition, believers represent Jesus on Earth as “citizens of heaven” and “ambassadors for Christ” (2 Cor 5:20, Phil 3:20-21) which makes them like the two spies. When God comes to judge the world those who believe the message they’ve heard from heaven’s ambassadors will be saved. Those that reject the message will be condemned on Judgment Day. The conditional statement, that governs who receives this covenant promise of eternal life versus condemnation was spoken by Jesus in John 3:16-21.