General Kelly would be the third retired general to get a senior position in Mr. Trump’s cabinet, reflecting the president-elect’s comfort with military men in important national security posts. He has selected Gen. James N. Mattis as defense secretary and named Lt. Gen. Michael T. Flynn as national security adviser. He is also considering David H. Petraeus for secretary of state.

But it is General Kelly’s experience with nonmilitary issues at Southern Command that put him in line for the Homeland Security post.

Less focused on combat than other regional military commands, Southern Command has a reputation for emphasizing “soft power” over hard military might. It gets deeply involved in issues such as migration, organized crime and disaster relief, as well as programs to train local militaries.

“A lot of the work we do with countries in our hemisphere focuses on transnational threats, like crime and drugs,” said Jeremy B. Bash, a onetime chief of staff to a former defense secretary, Leon E. Panetta, who worked closely with General Kelly at the Pentagon. “It is an excellent preparation for someone whose job it is to protect the border.”

General Kelly served as the senior military assistant to both Mr. Panetta and his predecessor, Robert M. Gates. He forged close ties to Jeh Johnson, who was then the Pentagon’s general counsel and later became secretary of Homeland Security.

Mr. Johnson, a person briefed on the matter said, considered General Kelly to take over the Secret Service after it fell into disarray amid a skein of scandals and security lapses.