3 different queries from 2 tables
Using sub queries this should extract all ID_Ps which only occur in the Layout table once and then INNER JOIN them with all ID_Bs which only occur in the Layout table once... essentially returning only ID_Ps with no more than one box per palette, and no more than one palette per box.

SELECT x.ID_P FROM  
  (SELECT ID_P, ID_B, COUNT(*) as count FROM Layout GROUP BY ID_P) x  
  INNER JOIN  
  (SELECT ID_P, ID_B, COUNT(*) as count FROM Layout GROUP BY ID_B) y   
WHERE x.count = 1 AND y.count = 1 AND x.ID_P = y.ID_P;