You can't generalise based on your own country. Here in Europe it's different. If it's your place you can kick her out if you are no longer together. If you are paying a rent 50/50 than it's different story.You might want to actually understand how the laws work with this type of thing before offering advice.
That is highly illegal. She has established residence there, he could go to jail for that or face large fines and/or have to pay restitution to her. If the judge is a super douche, and deoending on the state, she could even be awarded the house if he owns it.
And before someone chimes in with "its his place" or "she isn't on the lease/deed". In most states that doesn't matter.
This is the real reason not to live with someone if you want one. Once they establish residence(usually 30 days, but in some cases as little as 2 weeks or less) you are fvcked legally if you want them out and they don't want to leave. At least in the US. In Europe a lot of places are even worse! There are something called squatters rights where a person can break into your house if it is empty(aka you are on vacation) and start living there and you can't do anything about it legally and have to go to court to throw them out.
He would need to evict her if he wants her out and she refuses to go.
But that is only if he owns the house. If he is renting he can't evict, only the landlord could and you cannot just evict 1 person you would need to evict everyone that lives there(in most states, some may be different).
And good luck if you think calling the police will help. They will come and say "It's a civil matter" and leave.
So yeah all you geniuses that are advising him to throw her out/change locks, etc are setting him up for huge legal/financial issues down the road if she is vindictive and she(or anyone she tells what happened to her) knows a lawyer worth a dime. She could even take him to small claims court and he wouldn't have a leg to stand on legally. The best he can do is tell her he wants her to leave. If she refuses then he is kind of fvcked. At best it will cost him a bunch of money to have her removed.