Once passed away has calmed down, call the dog to the door (if vacant there already) and command him to sit or lay out.
It isn't so much a secret as is actually usually learning to understand the natural behavior of the canine plus the you could be the "leader of the pack". https://chatterchat.com/read-blog/86912