One of my dogs used to "lie" - he knew he wasn't suppose to be on the sofa. But he'd always push boundaries and try anyway like a human child. As soon as he'd hear you approaching the room, he'd just off (he was a no-fur dog).
What gave away his game was that sometimes his hind leg didn't quite get off the sofa. It was like a kid that took cookies for the cookie jar, even managed to get it back where it was supposed to be but then left obvious crumbs.