Today all persons are presumed to be qualified to serve as witnesses in trials and other legal proceedings, and all persons are also presumed to have a legal obligation to serve as witnesses if their testimony is sought. However, legal rules sometimes exempt people from the obligation to give evidence and legal rules disqualify people from serving as witnesses under some circumstances.
Privilege rules give the holder of the privilege a right to prevent a witness from giving testimony. These privileges are ordinarily (but not always) designed to protect socially valued types of confidential communications. For examples like; spousal privilege, advocate-client privilege, doctor-patient privilege, state secrets privilege and clergy-penitent privilege. A variety of additional privileges are recognized in different jurisdictions, but the list of recognized privileges varies from jurisdiction to jurisdiction; for example, some jurisdictions recognize a social worker–client privilege and other jurisdictions do not.
Witness competence rules are legal rules that specify circumstances under which persons are ineligible to serve as witnesses. For example, neither a judge nor a juror is competent to testify in a trial in which the judge or the juror serves in that capacity; and in jurisdictions with a dead man statute, a person is deemed not competent to testify as to statements of or transactions with a deceased opposing party.