I would treat the spawn area as 4 spawn rectangles. First ceil(random(4)) to pick which rectangle the first object spawns on, then create it (assuming origin point of the spawn rectangle is top left) at spawnrectangle.x+random(spawnrectangle. Width), spawnrectangle.y-random(spawnrectangle.Height)
For the other object, use layout.Width-object1.x and layout.height-object1.y to get the opposite location. (Or whatever width and height the total black area is, if your layout is bigger.)
This is slightly less than true random, because the corners will overlap and you have a higher chance of spawning there overall compared to the sides.