Characterizations of $H$-closed spaces