A rainforest is literally a rainy forest
That's pretty much it. "Rainforest" is not a specific, sharply defined term so it's used to refer to a wide range of regions that are thickly forested and have a high level of precipitation nearly year-round. So, let's talk about how to make each one of those happen.
Precipitation is largely determined by the large-scale circulation cells of the atmosphere, in which air travels cyclically between the surface of the Earth and the higher parts of the atmosphere. When the air is near the surface of the Earth, it warms because the surface of the Earth is warm due to solar heating. The Earth is warmest near the equator, so the hot air at the equator rises. In the upper atmosphere, the air loses much of its heat and cools down, and sinks again- usually in a different place than it rises. This concept is described better by the image here:
This is the most basic level of atmospheric circulation, but it is useful for small planets that rotate slowly (more on that in a sec).
Now, the connection to precipitation arises when we learn that warm air can "hold" more water than cold air. As this water cools, it condenses onto small particles in the atmosphere and eventually becomes water droplets large enough to see as clouds. If there's enough water, the droplets eventually become large enough that the air can't "support" them, so they fall to the surface as rain.
This is why we have the InterTropical Convergence Zone (ITCZ), a band of semi-permanent cloud cover that's found at the equator:
Guess what else we have at the equator? Rainforests. Yay!
Now, we also have temperate, or sub-tropical, rainforests. These are found in areas like New Zealand, Japan, the UK, or the Pacific Northwest. These areas are all at about the 60 degree line of latitude, and that's not a coincidence. On Earth, we're a medium-sized planet and we have a pretty good spin. This causes the single, idealized Hadley cell that I described earlier to break up into 3 cells (well, 6 total- 3 in each hemisphere). What this means is that we have a new location where warm, wet air rises- and this happens at 60 degrees north and south of the equator. Take a look at this image:
The six circulation cells are shown, and notice that the area under the equator and 60 degrees north and south is quite green, while the area at the poles and at 30 degrees north and south is desert-like. This breakup of the Hadley cell is due to phenomena explained by a lot of math that I won't talk about here.
Now, rain isn't pure water. It requires condensation nuclei, which are small particles from dust, volcanoes, smoke, salt, or even microorganisms.[Ref 1] [Ref 2] However, these are quite common in most atmospheres so I won't go into detail there either.
The other challenge is making sure your rainforest is dominated by trees instead of grasses or some other plant. Fortunately, this isn't as hard as it sounds- trees will grow in most places where there's a lot of precipitation, as they're restricted mainly by temperature and rainfall. In rainforests, trees represent secondary succession, which takes over from grasses and smaller plants. Secondary succession only occurs when there's an excess of nutrients and water, both of which should be abundant in rainforests.
Now that we've talked about the details and requirements for a rainforest, we can actually start talking about how to build one. I'm going to assume that you don't have any of the necessary conditions and we'll start from the ground up.
The best way to solve this problem is probably a biodome that has a lot of water pumped into it. However, you'll still need to have a massive amount of energy input into the system to consistently evaporate the water, as well as a cold roof of some kind to force condensation. Liquid water is important here because trees rely on transpiration to remain tall and vertical- you can't just have a humid environment or you won't have trees, and trees require a flow of water from the roots to the leaves. Biodomes have other problems, however- it'll be tricky to balance the atmospheric concentration exactly, and the dome as a whole is going to be massive. There's a small version of just such a biodome in England:
Another option could be artificially adding water, via a network of underground pipes. This assumes that your atmosphere is capable of supporting life and won't break organic materials apart via excessive reduction or oxidation. This method works pretty well for crops, especially in California where subsurface agriculture is almost exclusively used.
This method should work for trees as well. It would require a huge amount of water but you'd have very fine control over nutrients and the plants that grow. It wouldn't be self-sustaining in the least, but perhaps you don't need it to be.