So Luke trained his dog to be a cadaver dog ?
He very likely trained the dog as others do to sit, and bark to go out. No big deal. The reason it'll have stood on its back legs against the wall would have been because he'd smelled the presence of the girl if both were familiar with each other being that their senses are stronger than ours, he'd have got the scent of her clothing.