. . . but i couldn't find exact answer to her question that "How would they know that i was not inside Canada when there was no exit stamp on passport and she never traveled out of her country in last 3 years? "
Short answer: CBSA officials are better at their job than many give them credit. Good enough to make lying to them a very bad idea. Even if more than a few not-so-honest travelers get away with this or that.
And, to be clear, it is NOT what they "KNOW" but what they perceive, what impression they have, what suspicions are aroused.
And once a PR is engaged in a Residency Obligation examination, the burden of proof is on the PR. It is up to the PR to prove when he or she was in Canada. (Technically a PR can decline to answer immigration questions beyond those necessary to establish identity and status, but the scope of questioning for customs purposes can be very broad and if the traveler then declines to cooperate in questions about RO compliance no advanced degrees in rocket science necessary to map the trajectory from there, gravity taking over.)
The longer answer:
IRCC and CBSA keep a lot of what they do behind the curtain behind closed doors. The investigatory methods justification for confidentiality (as in NOT public information) has broadened considerably over the years. They do their best to keep the public from knowing how they assess information provided by clients.
Any attempt to answer that question, "how do CBSA/IRCC officials know when a PR has been outside Canada?" will fall way short of identifying all the means they have for assessing the veracity of information or the credibility of individuals.
What we do know is that their efforts to identify fraud have greatly expanded in just over the last decade, the technology supporting that effort has been enhanced greatly over this same period of time, including expanded record capturing and more efficient access to records. Thus, even though many probably still get away with a lie or three, the number being caught and the consequences, combined, make lying to PoE officers a rather bad gamble.
I disagree some with the suggestion that officials review flight ticket data, airline passport scans, or previous trip customs declarations, at least NOT in the routine or usual case. (Such records might, possibly, be accessed and considered in the course of a more formal investigation, but if that happens, by the time that happens, the PR who has lied has undoubtedly been found out and is the subject of proceedings headed toward the more severe range of consequences.)
In the usual case, upon a PR's arrival at a PoE it is not likely that border officials are looking at flight ticket data, airline passport scans, or previous trip customs declarations (obviously they do look at the traveler's current custom declaration when arriving on an airline, but not past declarations).
In the usual case, when a PR applies for a new PR card it is also NOT likely that IRCC will access and review any of these either.
In the usual case, however, there are many indicators amply illuminating it is NOT likely there is any reason to question the PR-traveler about Residency Obligation compliance.
In contrast, if officials perceive some reason to question a PR about Residency Obligation compliance, yes they can access and consider the client's CBSA travel history, and except for American citizens who are Canadian PRs they can indeed access entry into the U.S. from Canada records effectively constituting a record of exiting Canada to the U.S. (and at some stage this information will be available even for American citizens who are PRs).
How it goes in the course of processing a PR card application is a big topic all its own.
How it goes at a PoE begins with a PIL official mostly looking for any clue, any hint, that the traveler should be questioned or examined more extensively. OR, at the airport it appears that Canada has joined some other countries in implementing kiosks which have sophisticated screening technology, which in addition to facial scanning appears to detect movement patterns, even of the individual's toes, which supposedly reveal tell-tale indicators of deception. (No idea how many such kiosks Canada has actually put into operation . . . first read about these about a year ago as I recall.)
As for the questions, the PIL official makes a concerted effort to discern who needs to be asked more questions, and while the content of the traveler's answers are important, the official is evaluating a lot more than just the content. They are always juggling and changing the questions asked and even the most basic questions, like "where do you live?" are often asked in slightly different ways. Likewise questions about employment.
Any attempt to script one's responses to PoE questions tends to be foolish.
What works? Just the facts. The truth. Simple, honest answers work.
Again, it is NOT about what the officials "KNOW." It is a lot about to what extent the officials believe the traveler. If they doubt the traveler's credibility, they ask more questions. If the traveler's response to those additional questions satisfy the official, that works. But once the PIL officer discerns enough to refer the traveler to Secondary, the officer in Secondary will both look at and consider more of the traveler's history in conjunction with asking more probing questions. And once it is discerned the traveler has not been honest, again no advanced degrees in rocket science necessary to map the trajectory from there, gravity taking over . . . that is, it goes downhill fast.