For a quaternion matrix A, we denote by Aϕ the matrix obtained by applying ϕ entrywise to the transposed matrix AT, where ϕ is a nonstandard involution of quaternions. A is said to be ϕ-Hermitian or ϕ-skew-Hermitian if A=Aϕ or A=−Aϕ, respectively. In this paper, we give a complete characterization of the nonstandard involutions ϕ of quaternions and their conjugacy properties; then we establish a new real representation of a quaternion matrix. Based on this, we derive some necessary and sufficient conditions for the existence of a ϕ-Hermitian solution or ϕ-skew-Hermitian solution to the quaternion matrix equation AX=B. Moreover, we give solutions of the quaternion equation when it is solvable.