TL;DR: Through precedent, volunteers are protected from discrimination under the Ontario Human Rights Code. A decision made by the Human Rights Tribunal found that volunteer employment can be considered employment under the Human Rights Code.
Section 5(1) of the Ontario Human Rights Code forbids any discrimination in employment that arise from any of the code grounds. I’m completely assuming that the discrimination presented is not where equal treatment to employment is not infringed under s. 24(1), areas where rights are not infringed from bona fide qualifications, or other laws that cover retiring ages (such as the the Justices of the Peace Act), as well as others.
Definition of Employment
To find whether volunteering qualifies as employment, it would be helpful to find the definition of an employee, and the definition of employment first.
The issue here, is that the Human Rights Code does not define the terms “employee” or “employment” within the statute. s. 10(1) includes definitions for many terms, including "record of offences" and "disability, " however, no such definition of the term "employee" or "employment" exists.
Naturally, we’d go on to look to other laws where a definition of these terms will exist. The Employment Standards Act includes such definitions in s. 1:
(a) a person, including an officer of a corporation, who performs work for an employer for wages,
(b) a person who supplies services to an employer for wages,
(c) a person who receives training from a person who is an employer, as set out in subsection (2), or
(d) a person who is a homeworker,
and includes a person who was an employee;
The term “wages” follows this definition:
(a) monetary remuneration payable by an employer to an employee under the terms of an employment contract, oral or written, express or implied,
(b) any payment required to be made by an employer to an employee under this Act, and
(c) any allowances for room or board under an employment contract or prescribed allowances,
Under the act, an employee basically needs to be working, and receiving a wage. A volunteer, or even an unpaid intern, does not seem to qualify as being an employee. Since no definition of “employee,” or even “employment” exists within the Human Rights Code, it is the definitions in the Employment Standards Act which will likely be used.
From this information, you’d probably lose a bit of hope. Are volunteers at risk of being discriminated against in areas such as volunteer employment?
Since we live in an area with a common law tradition, the decisions made in other cases are very important. In fact, in 2012, the Human Rights Tribunal of Ontario ruled that the Human Rights Code does indeed apply to volunteering. In fact, the Tribunal made note of how to interpret the legislation in *Rocha v. Pardons and Waivers Canada, 2012 HRTO 2234 (CanLII). Adjudicator Judith Keene said the following:
 Clearly, the applicant was prepared to work without pay for a period of time. Does this fact remove the Application from the scope of the employment provisions of the Code?
 In my view it does not. The broad application of Part I of the Code is signalled by the use of the term “with respect to”. It is not qualified in any way. A phrase similar to “with respect to” was interpreted by the Supreme Court of Canada in Nowegijick v. The Queen, 1983 CanLII 18 (SCC),  1 S.C.R. 29 at p. 39:
The words "in respect of" are, in my opinion, words of the widest possible scope. They import such meanings as "in relation to", "with reference to" or "in connection with". The phrase "in respect of" is probably the widest of any expression intended to convey some connection between two related subject matters.
 In the factual context of this case, it is clear that the applicant made this offer with a view to achieving paid employment. In view of the above facts and the use in the Code of the phrase “with respect to”, I find that an offer to work without pay in the process of achieving paid employment does not operate to remove this fact situation from the ambit of the employment provisions of the Code.
 In the alternative, I find that volunteer employment can be considered “employment” for the purposes of the Code. Volunteer work has been included in the area of "employment" in cases decided under the human rights legislation of other jurisdictions: Brown v. Robinson(1989), 10 C.H.R.R. D/6286 (B.C.C.H.R.); Thambirajah v. Girl Guides of Canada (1995), 26 C.H.R.R. D/1; Nixon v. Vancouver Rape Relief Society (No. 2) (2002), 42 C.H.R.R. D/20, 2002 BCHRT 1. This is not surprising in view of applicable principles of statutory interpretation of human rights legislation.
 In numerous decisions, the Supreme Court of Canada has ruled that a broad, policy-based and liberal interpretation must be given to human rights legislation and the policies behind such legislation: see Canadian National Railway Co. v. Canada (Canadian Human Rights Commission), 1987 CanLII 109 (SCC),  1 S.C.R. 1114; Quebec (Commission des droits de la personne et des droits de la jeunesse) v. Boisbriand (City), 2000 SCC 27 (CanLII),  1 S.C.R. 665; B. v. Ontario (Human Rights Commission), 2002 SCC 66 (CanLII),  3 S.C.R. 403 at para. 44.
As directed by the Supreme Court of Canada, and as noted in the decision by the Human Rights Tribunal, human rights legislation should be interpreted as broadly, and as liberally as possible. Volunteer employment is protected under many decisions made by the Tribunal, including Sprague v. Yufest, 2016 HRTO 642 (CanLII) and Swain v. MBM Intellectual Property Law LLP, 2015 HRTO 1011 (CanLII).
From this, it’s reasonable to conclude that volunteer employment is covered under the Ontario Human Rights Code, and that you are protected from discrimination under any of the code grounds.