I’m sure that @Love_my_doggie has the correct response … if everything aligns in the proper way. It’s just unlikely to meet the requirements to register and vote (only in a primary election for that state) in one jurisdiction, then move to another state and register and be in time for that state’s primary. It would be a violation if he had not established residency – according to the new state – while registering to vote there, but if everything were done according to the rules, it should be no problem at all.
Obviously, this kind of opportunity (if you want to think of it that way) could only work for primary elections, and only for states that have primaries on different dates, and spaced far enough apart to permit the move-register-vote sequence after the vote in the first state. It can’t work for a general election, because a voter can only be registered in one location for one vote. (Attempting to vote absentee from one state after having moved to another state to vote in person would be a clear case of voter fraud.)
If he really wants to do this, and if he still has doubts, he can clear them up with a call to the Secretary of the State’s office, or probably even a local voter registrar at City Hall in his new location.