I'll try to solve your query by way of an example.
X= 2*Y + a + e $X= 2*Y + a + e$, here you go Short on X$X$ and Long on Y$Y$, and the coefficient of Y$Y$ is 2$2$. Let's say X=100$X=100$ and Y=49$Y=49$ (i.e. X's$X$'s and Y's$Y$'s current price) and a=1$a=1$ and also e=1$e=1$.
Now you need to execute a trade to make money when e$e$ becomes 0$0$.So So in order to make money from the trade, you will sell 1 share of X$X$ and buy 2 shares of Y$Y$. Now where ever the price will move if your coefficients are same i.e 2 and a=1$a=1$, the moment e$e$ becomes 0 you'll make money.
In this pair trade you don't need to put equal money in both X$X$ and Y$Y$, but whatever quantity of X$X$ you sell you have to buy twice quantity of Y$Y$.