Calculating DPO

Lauren
Just wondering if you count your DPO based on the first or last day you ovulated? Also how many days after the last day your fertile window would be the earliest you would test? In my 2WW now and getting anxious!