What Kind of Glue Should Use?
You can use a good quality Latex Painters Caulk or Lochtite Power Grab foamboard adhesive. After you have applied the glue, lightly press your molding to the wall and hold for 10-15 seconds. (Make sure the molding has good contact with the wall.) The glue typically dries in 90 minutes. So if you come down from your ladder and look up at the molding and see a section out of place, you have that much time to go back up the ladder and adjust accordingly.
*DO NOT USE Liquid Nails as they are high in VOC’s and Solvents which could possibly damage the foam molding.