I got my home in Dec 2014 and rented it out between July 2015 and June 2016 and sold it July 2018 How many years should I report as my principal residence/own the place?
For number of years owned, you should enter the years the property was under your name.
For number of years as principal residence, you should enter the number of years you lived in the home as your principal residence.
what if I lived in it for 6 months in 2016 and 6 months in 2017?
Since the property was sold in 2018, you would be reporting the sale of your principal residence when you file your tax return next year (2019) for tax year 2018.
You can only claim whole year. For fractional number you can round the number to a whole year. Please see the section "The ordinarily inhabited rule" in the link below to get more information:
https://www.canada.ca/en/revenue-agency/services/tax/technical-information/income-tax/income-tax-folios-index/series-1-individuals/folio-3-family-unit-issues/income-tax-folio-s1-f3-c2-principal-residence.html#N10303