DPO questions

Holly • 31 year old lover of Jesus and wife of man. Baby #5,due 7/19
I know this gets asked a million times but what day is it okay to test? When is the earliest to test? Also which day are we testing from? I BD on my secound to last day of O, but not the last so would I start counting from the last day I BD during O or the last day of O? So if I BD last Sunday but O ended Monday would I be 8 dpo or 7?