A compound is provided which is represented by the following general formula (I) or (II) as shown in the description, wherein X is selected from CR4 or N; R1 to R4 are each independently selected fromhydrogen, C1-C10 alkyl, substituted or unsubstituted C5-C60 aryl or heteroaryl, the aryl or heteroaryl substituent is selected from deuterium, fluorine, methyl, methoxy, cyano, phenyl, biphenyl, naphthyl, phenanthrenyl, pyridyl, furanyl, thienyl, indenyl, benzofuranyl, benzothienyl, substituted or unsubstituted indolyl, dibenzofuranyl, dibenzothienyl, substituted or unsubstituted carbazolyl, benzocarbazolyl, dibenzocarbazolyl, and the indolyl and carbazolyl substituents are selected from phenyl, biphenyl, naphthyl, phenanthrene. The dashed line and Cy in the general formula (II) represent a five-membered or six-membered aromatic ring or an aromatic heterocycle fused with a pyrimidine ring. The compound can be used in organic electroluminescence devices. The invention also provides an organic electroluminescence device comprising the compound.