Three-dimensional effective theories for the two Higgs doublet model at high temperature