Computing the commutator of the Fock and density matrices in AO basis (Hartree-Fock theory)
Start from the AO Hartree-Fock equation and its adjoint 
$$\mathbf{F}^{AO}\mathbf{T}=\mathbf{S}\mathbf{T}\epsilon \text{ and } \mathbf{T^\dagger}\mathbf{F}^{AO}=\epsilon\mathbf{T^\dagger}\mathbf{S}$$

where $\mathbf{T}$ is an $N\times n$ matrix that is essentially the occupied block of $\mathbf{C}$ ($n$ is occupied, $N$ is total orbitals). We use this $\mathbf{T}$ matrix because it has the convenient property that 

$$\mathbf{T}\mathbf{T}^\dagger=\mathbf{D}^{AO}$$

Now, we can multiply the HF equation by $\mathbf{T^\dagger}\mathbf{S}$ on the right and multiply its adjoint by $\mathbf{S}\mathbf{T}$ on the left, which gives

$$\mathbf{F}^{AO}\mathbf{T}\mathbf{T^\dagger}\mathbf{S}=\mathbf{S}\mathbf{T}\epsilon\mathbf{T^\dagger}\mathbf{S}$$

$$\mathbf{S}\mathbf{T}\mathbf{T^\dagger}\mathbf{F}^{AO}=\mathbf{S}\mathbf{T}\epsilon\mathbf{T^\dagger}\mathbf{S}$$

Subtracting the first equation from the second and yields the desired commutator relationship.

$$\mathbf{F}^{AO}\mathbf{D}^{AO}\mathbf{S}-\mathbf{S}\mathbf{D}^{AO}\mathbf{F}^{AO}=\mathbf{0}$$

The notation I use here is based on a similar derivation given in Chapter 6 of McWeeny's Methods of Molecular Quantum Mechanics, 2nd edition.