Freddie Mac is preparing to name Donald Layton, the former chief executive of online brokerage E*Trade Financial Corp., as its next CEO, according to people familiar with the matter. The company is expected to announce the hiring as soon as Thursday, these people said. That would end a six-month search for the mortgage giant’s third chief executive in the four years since the government took control of it. Mr. Layton had been considered the frontrunner for the job for more than a month. His appointment is subject to approval by the Federal Housing Finance Agency—which regulates Freddie and its sibling, Fannie Mae—and by the Treasury Department.