Control of spontaneous emission of qubits from weak to strong coupling