Amazon.com Inc. plans to split its second headquarters evenly between two locations rather than picking one city, according to a person familiar with the matter, a surprise decision that will spread the impact of a massive new office across a pair of communities.

The driving force behind the decision to build two equal offices for “HQ2”—in addition to the company’s headquarters in Seattle—is to allow it to recruit more of the best tech talent, according to the person familiar with the company’s plans. The move will also ease...