how do electrons in 2 separate atoms change its energy level when atoms come close together to form molecule? The question is just as the title. It's said that electron must receive a specific amount of energy in order to go or drop to another energy level. So how can electrons of separate atoms which have same energy level (because the atom a separate so it doesn't violate Pauli exclusion principle) change its energy level to be slightly higher or lower than each others to create energy band
 A: How does a molecule form? At the most general level the idea is that there exist lower energy states with the atoms in the molecule closer to each other, and the original joint state of the atoms had a nonzero ability to transition into that lower energy state and give up some energy.
The rest is really some thermodynamics. If everything is hot and dense enough it can also absorb energy and get back to those excited states. But if instead that energy gets passed on to something roughly colder, then it is unlikely to get the energy back and the atoms get stuck in the closer state. But this skips over all the details of the quantum mechanical interaction.
And it sounded like you wanted to see the Pauli exclusion principle in play, so keeping in mind that the true details will depend on this transition, let's see how exclusion goes on.
First fact, the wavefunction is a function from configuration space into a joint spin space. Let's look at the formation of $H_2$ out of two $H^1$ atoms and let's treat the protons as point particles and for now ignore anything else that would be responsible for getting them stuck in that lower energy, we just want to start with seeing Pauli exclusion in play.
So the wave is a function from $$\mathbb R^3\times\mathbb R^3\times\mathbb R^3\times\mathbb R^3\rightarrow\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2.$$
And the antisymmetry of Pauli exclusion says that if $\Psi(\vec r_1,\vec r_2,\vec r_3,\vec r_4)$ corresponds to the joint spin state when there being an electron at $\vec r_1$ and another at $\vec r_2$ and a proton at $\vec r_3$ and another proton at $\vec r_4$ then $\Psi(\vec a,\vec b,\vec c,\vec d)=-\Psi(\vec b,\vec a,\vec c,\vec d)$ and $\Psi(\vec a,\vec b,\vec c,\vec d)=-\Psi(\vec a,\vec b,\vec d,\vec c).$
So the state starts out with that symmetry and the Hamiltonian will preserve that symmetry. The wavefunction is large (has large elements of $\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2$ and by large we mean far from zero) when for instance $\vec r_1\approx\vec r_3$ and so because of the symmetry it must also be large when $\vec r_1\approx\vec r_4$ but of course those correspond to two totally different regions of configuration space.
Let's imagine a specific slice say the protons are at (0,0,0) and (0,0,5m) and the electrons are at (0,0,x) and (0,0,y) so really we are imagining the z coordinate of one electron as the x axis and the z coordinate of the other electron as the y axis and fixing all the other 10 coordinates.
Now the wave is large near (5,0) and near (0,5) and for a point $(\epsilon_1,5+\epsilon_2)$ you get a certain spin state in $\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2$ and for the point $(5+\epsilon_2,\epsilon_1)$ you get a certain spin state in $\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2$  that is the negative of the other one. So you can imagine it like a potential shooting up near (5,0) and shooting down near (0,5) except is isn't real valued, it is $\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2$ valued and so has lots of room to wiggle instead of just going up and down.
Now the Schrödinger equation has terms like $-\hbar^2/2m_e\partial^2/\partial x_1^2$ for part of one of the electron's kinetic energy and
$-\hbar^2/2m_p\partial^2/\partial x_2^2$ for part of one of the proton's kinetic energy and the potential energy has terms like $ke^2/|\vec r_1-\vec r_2|$ and $-ke^2/|\vec r_1-\vec r_3|$ for electrostatic attraction between electrons and protons and electrostatic repulsion between electrons.  But the Hamiltonian treats the two electrons the same and treats the two protons the same, so that initial antisymmetry under exchange is itself preserved.
So you have a wave in configuration space that was large only for configurations where each electron is within a bohr radius of one of the protons and one electron is near each proton. Every other configuration has a very small value.
But even if you have a configuration where the protons are far apart, this is a possible configuration for the ground state of the hydrogen molecule, but like an electron could be found far from a proton in a hydrogen atom, the protons could be far from each other, just the wave is smaller there so probably they won't be found there.
So you probably didn't start out in an energy eigenstate and start out with the protons so far away (and really you started in a state, not a configuration, but the dynamics of the current st a configuration collectively tell you the dynamics of the state, so discussing evolving configurations can be easier for dynamics), so imagine you aren't in an energy eigenstate. You start out with a certain antisymmetry, and this just gets preserved.
But maybe some photons interact differently with different energy states, then over time you can evolve so that your state and the state of the electromagnetic field coevolve to become entangled and then each branch of the entangled system can now have different states for the foursome of two electrons and two protons, and some of those branches have the foursome be in a lower energy state and have the energy of the electromagnetic field heading out into space or into something cold and if that energy isn't coming back the molecule could be stuck in that lower energy state for a while.
Now if the wave is largest when the protons are a certain distance away in that ground state, then to have a good transition into that state you want your current state to line up well, basically during the entanglement you have to evolve into looking like that energy state in that 12 space. So your wave truly does have to get large at that distance. So only waves that had large nonzero values corresponding to configurations with the center of mass of an electron proton pair heading towards the the center of mass of the whole system will achieve this.
So what I'm saying I'd that for each configuration in 12 space you have a region around it and based on how the phase of the values in $\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2$ are changing there is a current and you need the currents components for the four particles to be generally heading towards their common center of mass. When the configuration of the four particles has an electron proton pair that are within a Bohr radius or so and the center of mass of that pair has the phase of changing in a direction that sends the current pointing towards the other two particles then the low energy configurations look similar to a hydrogen atom wave in the space $(\vec r_1,\vec r_3)$ multiplied by a function that looks like a hydrogen atoms in the space $(\vec r_2,\vec r_4)$ for example.
And if you didn't know what those look like, they look like free particles in the center of mass and a hydrogen electron for the relative vector say $\vec r_1-\vec r_2.$ So if the free particle motion of the center of mass has the atoms heading to each other then as they get closer it becomes more efficient for light to interact with it to transition it into a truly lower energy state.
And that's generally what happens. If you can dynamically visualize a changing function from $$\mathbb R^3\times\mathbb R^3\times\mathbb R^3\times\mathbb R^3\rightarrow\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2\otimes\mathbb C^2$$ then you are most of the way to seeing it, the rest is just an interaction with light that is strongest when you pick a state that is already fairly well localized for each atom and is heading towards a state close to that energy eigenstate.
So basically the total system wasn't in a true eigenstate. When you take eigenstates for the single atoms the product of such eigenstates has a low expectation value of energy but isn't a true eigenstate of the total system. When it evolves to be close to one, then a transition is easier. But really that is all just about aligning the phases between he parts and the thing doing the transition, it was always a combination of the things it was a combination of.
A: When the atoms get close to each other, the electrons of the first begin to feel the nuclei of the second, and vice versa.   So, for example, when two hydrogen atoms approach each other, we have to consider the the potential due to all four particles (and the Pauli principle, but that issue doesn't have a bearing on the kernel of your question).  The potential that one of the electrons feels is different than the potential it felt when the atoms were far away from each other.  
One has to solve the problem as a single system.  When that is done, there is only a slight effect when the atoms are far away, and the energy levels are almost the same, but not exactly the same... there is a splitting.  As they approach, the effect is not so slight, and at some point it becomes almost impossible to identify the relationship between the energy levels of the system with the energy levels of the constituent atoms.
