For example, if your final destination is Paris, France, but you have a layover in Madrid, Spain, you will actually go through customs in Spain, not France. Then, when you arrive in Paris, you won't go through customs a second time. You will be free to grab your bags from the terminal and leave the airport.