I made a command creation that tests for an iron block 1 block lower from an armor stand and after that it test for a diamond block 2 blocks lower and when it does that it spawns a command block that spawn a structure block to finally spawn a house. This worked fine but i saw that it only works if there is no other armor stand around it and when there is one that is closer to the command then it does not work. Here are the commands:
/execute @e[type=Armor_Stand,c=1] ~ ~ ~ /testforblock ~ ~-1 ~ iron_block
/execute @e[type=Armor_Stand,c=1] ~ ~ ~ /testforblock ~ ~-2 ~ diamond_block
/execute @e[type=Armor_Stand,c=1] ~ ~ ~ /scoreboard players tag @e[type=Armor_Stand,c=1] add stone
/execute @e[type=Armor_Stand,c=1] ~ ~ ~ /setblock ~ ~-2 ~ minecraft:structure_block 0 0 {metadata:"",mirror:"NONE",ignoreEntities:0b,powered:0b,seed:0L,author:"AlexDAM",rotation:"NONE",posX:-4,mode:"LOAD",posY:-1,sizeX:9,posZ:-4,integrity:1.0f,showair:0b,name:"9x9House",id:"minecraft:structure_block",sizeY:6,sizeZ:9,showboundingbox:1b}
/execute @e[type=Armor_Stand,c=1] ~ ~ ~ /setblock ~ ~-1 ~ redstone_block
/kill @e[type=Armor_Stand,tag=stone,c=1]
Also all the chain commands are on Conditional mode.