In order to decide whether or not a precipitate is formed in a certain reaction, you must become familiar with the solubility rules
Let's take the first reaction - barium nitrate reacts with sodium sulfate. If you examine the solubility rules shown above, you'll notice that all nitrates are soluble, which means that both barium nitrate, and the nitrate that'll be formed in the reaction, are soluble.
On the other hand, sulfates are soluble with the exception of those formed with several cations, including barium. This means that barium sulfate, one of the two products of this double replacement rection, will be insoluble, i.e. it will precipitate.
In the second reaction, a sodium phosphate (trisodium phosphate to be exact) reacts with copper chloride. According to the solubility rules, all phosphates are insoluble with the exception of those formed with alkali metal cations, which means trisodium phosphate is soluble.
However, one of the products of this reaction will be copper (II) phosphate; since phosphates formed with copper cations are not an exception to the general rule, this product will be insoluble.