A helpful division of Joshua 2 is as follows:1
A. The commissioning of the spies by Joshua (Joshua 2:1)
B. The spies' arrival in Jericho and concern regarding their safety (Joshua 2:2–7)
C. Rahab’s confession of faith (Joshua 2:8–14)
B’. The spies' escape from Jericho and concern regarding their safety (Joshua 2:15–21)
A’. The spies arrive back to report to Joshua (Joshua 2:22–24)
This arrangement is chiastic. The purpose of arranging material in this way is to draw our attention to the central speech of Rahab. Rahab’s confession of faith is the central focus of the chapter.
1 And Joshua the son of Nun sent two men secretly from Shittim as spies, saying, “Go, view the land, especially Jericho.” And they went and came into the house of a prostitute whose name was Rahab and lodged there.