To transition from column with profile to column with profile , you try placing tiles in all valid ways. Each placement decision updates which cells protrude. For a horizontal domino, you fill two cells in the same row without changing the profile.
For a vertical domino, you fill one cell in the current column and mark the next column's corresponding cell as occupied. You recursively try all placements for each row, building the next profile as you go. Only profiles where all cells get filled are valid transitions.