You are considered infectious two days before your symptoms started. If you are asymptomatic, you are considered infectious two days before the day you took your test. You are considered infectious until your isolation ends.
Close contacts are everyone who was within 6 feet of you for more than 15 minutes while you were infectious. The 15 minutes are cumulative over 24 hours, so if you are close to someone for 5 minutes three times in one day while infectious, they are a close contact.
If positive for COVID, you do not need to get tested again in order to come out of your isolation. Because dead virus particles remain in your body even after you are no longer infectious, the COVID test may still come back as positive. This means the test can’t determine when you are no longer contagious. When your isolation period is over, you are no longer considered contagious.
A "close contact" is defined by the CDC as someone who was within 6 feet of an infected person for a total of 15 minutes or more over a 24-hour period starting from 2 days before illness onset (or, for asymptomatic patients, 2 days prior to their test) until the time the patient is isolated.