  We present a study on structures and physical properties of massive ($M_*
>10^{10} M_{\sun} $) compact galaxies at $1.0<z<2.0$ in five 3D--{\it
HST}/CANDELS fields. Compared with the extended star-forming galaxies (eSFGs),
compact star-forming galaxies (cSFGs) are found to have the lower level of star
formation, and mainly distribute in the quiescent region of the {\it UVJ}
diagram. The distributions of dust attenuation and S{\'e}rsic index support
that the progenitors of cQGs are cSFGs, and cSFGs are at a transitional phase
between eSFGs and cQGs. The prevalence of X-ray selected AGNs ($\sim 28\%$) is
confirmed in the cSFGs at $1<z<2$ which indicates that the violent gas-rich
processes such as merger and disk instability could drive the structure to be
more compact, and trigger both star formation and black hole growth in the
central regions. Our results support the "two-step" scenario that the cSFGs at
$1<z<2$ are the intermediate population after compaction but before a quick
quenching. Our analysis of parametric and nonparametric morphologies shows that
cQGs (eQGs) are more concentrated and have less substructures than cSFGs
(eSFGs), and quenching and compactness should be associated with each other.
The cSFGs at $1.5<z<2$ ($1<z<1.5$) prefer to be in higher (lower) density
environment, similar as cQGs (eSFGs). It suggests that merger or strong
interaction might be the main driving mechanism of compaction at higher
redshifts, whereas the disk instability of individual galaxies might play a
more important role on the formation of cSFGs at lower redshifts.
