This is a question of ordinary evidence law. See How do you prove a fact at issue in litigation? Evidence would typically come from testimony. The trier of fact (the judge or a jury) then is to weigh all the admissible evidence, including by weighing the witness and party testimony according to its credibility and reliability after testing through cross-examination, to come to a conclusion on the ultimate question(s) at issue.
Some evidence is inadmissible for two particular purposes though. See Criminal Code, s. 276:
evidence that the complainant has engaged in sexual activity, whether with the accused or with any other person, is not admissible to support an inference that, by reason of the sexual nature of that activity, the complainant (a) is more likely to have consented to the sexual activity that forms the subject-matter of the charge; or (b) is less worthy of belief.
And the trial cannot become a contest of credibility where the finder of fact is simply determining who they believe more. The Crown must prove beyond a reasonable doubt that the complainant did not consent. It is not enough that the finder of fact finds the complainant more credible than the accused. See R. v. S. (W.D.),  3 S.C.R. 521