For sure, $A$ and $B$ do not lie both on $h$ since otherwise they would determine both straight lines $g$ and $h$ (2nd axiom of connection) and, by hypothesis, $g\neq h.$
Therefore, at most one of the points $A$ and $B$ lie on both straight lines at once.