Constructing two-qubit gates with minimal couplings