Your friend arrives with their dog. 40 minutes later your 13 month old is still bodyslamming a dog who stopped enjoying this a while ago. Everybody says let them sort it out, and that advice assumes 1 of the 2 dogs has brakes.
Why it does not wind down on its own
Play that has gone past fun is arousal, not sociability. Your dog is not being unfriendly, and they are also not able to stop from the inside. Good play has turns and breaks, and both dogs can walk away without being followed. If the visiting dog is turning away, hiding or trying to get on the sofa, that is a no, and answering it is your job.
Run the visit like this
Meet outside first and walk the 2 dogs side by side for 15 minutes before anyone goes indoors.
Pick up the toys, chews and food bowls before your visitors arrive.
Set a timer for 5 minutes of loose play, then call your dog away for a chew behind a baby gate.
Repeat that pattern. 5 minutes on and 20 minutes settled, rather than 2 hours of unbroken access.
Give both dogs a real rest at the halfway point, in separate rooms, with the doors shut.
End the visit while it is still going well, not once somebody has snapped.
Calling your dog away and paying them is a no your dog can learn from. Shouting, grabbing a collar or pinning is not, and punishment-based approaches are associated with fear, avoidance and defensive aggression. Behaviour change is built from management plus reinforcement together, and the gate is the management. Learning also happens below the level at which a dog is over their limit, and a living room at full speed is above that line.
When not to host at all
Either dog is frightened of other dogs, or has been in a fight in the last few months.
Your dog guards food, chews, toys, the sofa or a person.
There is nowhere in your home where you can fully separate the 2 dogs.
You cannot supervise the whole visit, because you are cooking, working or watching children.
In any of those cases, walk the dogs 10 feet apart with no greeting instead. That is a real social outing.
Safety note
Separate the dogs and end the visit if you see stiffness, a hard stare, a raised lip, or a growl over food. The same goes for a scuffle of any kind, and do not put them back together to see whether it settles. If either dog has bitten or broken skin, get help now. Contact your veterinarian and ask for a referral to a qualified behaviour professional before the dogs meet again.
Today's version, in one line: before the next visit, pick up every toy and set a 5 minute timer for the first play session.