Per IRS regulations:
""You have to be enrolled at least half time in a program leading toward a degree, certificate or other recognized educational credential for at least one academic period during the tax year"
You can read more about that here:
So it would depend more on your period of enrollment than whether you completed the courses, or the grade you received.
As a practical matter, it will often by marked on your form 1098-T if the educational institution considered you to be enrolled at least half-time.
**Mark the post that answers your question by clicking on "Mark as Best Answer"