The answer to your question is not trivial. What you are observing here is a phenomenon call "return value optimization" (RVO).
But let's start at the beginning. What did you expect your program to produce? I would have said:
constructor is invoked.
copy constructor is invoked.
copy constructor is invoked.
copy constructor is invoked.
Why should the first of the assignment statements involve two calls of the copy constructor? Well, one for generating the return value and one for assigning the return value to the variable Principal.
For the second statement we only expect the copy constructor to be called once, because the function returns a reference to the Human object, which does not involve the copy constructor.
When run in a debugger you can see that the first assignment does not produce two but just one call of the copy constructor. And that is due to a rule called "return value optimization". You find a nice article about it here:
Wikipedia: Return Value Optimization[
^]
When the compile sees that the intermediate object generated as return value is just assigned again to another object and then destroyed, it is allowed to skip the generation of that intermediate object. And that's what is happening here.
Well observed, and an interesting question!