We study two-valued local sets, A −a,b , of the two-dimensional continuum Gaussian free field (GFF) with zero boundary condition in simply connected domains. Intuitively, A −a,b is the (random) set of points connected to the boundary by a path on which the values of the GFF remain in [−a, b]. For specific choices of the parameters a, b the two-valued sets have the law of the CLE4 carpet, the law of the union of level lines between all pairs of boundary points, or, conjecturally, the law of the interfaces of the scaling limit of XOR-Ising model.Two-valued sets are the closure of the union of countably many SLE4 type of loops, where each loop comes with a label equal to either −a or b. One of the main results of this paper describes the connectivity properties of these loops. Roughly, we show that all the loops are disjoint if a + b ≥ 4λ, and that their intersection graph is connected if a + b < 4λ. This also allows us to study the labels (the heights) of the loops. We prove that the labels of the loops are a function of the set A −a,b if and only if a = b and 2λ ≤ a + b < 4λ and that the labels are independent given the set if and only if a = b = 2λ. We also show that the threshold for the level-set percolation in the 2D continuum GFF is −2λ.Finally, we discuss the coupling of the labelled CLE4 with the GFF. We characterise this coupling as a specific local set coupling, and show how to approximate these local sets. We further see how in these approximations the labels naturally encode distances to the boundary.2010 Mathematics Subject Classification. 60G15; 60G60;60D05; 60J67;60K35; 81T40.